Cron is a job scheduler that allows users to run commands periodically.

learn more… | top users | synonyms (1)

3
votes
3answers
526 views

Is setting a higher nice level for a process an effective way to reduce its impact on system load/CPU time?

I have an rsync cron job which is pushing the server load and triggering monitor alerts. If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system ...
0
votes
2answers
241 views

How to add the logs to a crontab with time stamp [duplicate]

In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below. 0 0 * * * /home/backup.sh > ...
3
votes
2answers
198 views

Bash if script is called from terminal echo stdout to terminal, if from cron do not echo output

I would like to have a service watchdog script echo the status to the screen if called like ./watchdog.sh but if it is run by cron, there is no need to echo output. What is the proper method? Where ...
0
votes
1answer
165 views

Mysterious automated emails

I remember messing around with crontab and setting up email capabilities on a server many months back, and now all of a sudden I'm getting the following email: EMAIL HEADER: from: root ...
3
votes
3answers
63 views

Where to put system cronjobs?

If I need a cronjob that runs at system level (i.e. not specific for a certain user) how do you suggest me to create it? running crontab -e as root appending it to /etc/crontab creating a file ...
0
votes
1answer
517 views

Create cron as a apache user and run as root user

I am creating this cron as apache user and want to run this cron as root, below is my code snippet: # Create a cron job to restart apache cron_file="/etc/cron.d/restart_apache_crontab" cron_job="*/1 ...
-3
votes
4answers
5k views

Cronjob for rebooting everyday

I have set this cronjob because I want my server to be rebooted everyday at 05:00 # file: /etc/cron.d/reboot * 5 * * * root reboot &> /dev/null I think it worked the first time as I was ...
0
votes
1answer
84 views

Why don't these cron jobs run?

Here is my crontab: # rsnapshot jobs 0 9-21 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf hourly 52 22 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf daily 42 22 ...
-1
votes
2answers
189 views

Shell script passing null value while executed as cron job [closed]

We are using the below commands to get pagesapce values and I need to check percent of used pagespace. For this I have used the below code, but when running this script it's passing a null value into ...
0
votes
1answer
117 views

Why does OpenSSL automatically send me Terminal mail?

I for some reason am getting messages from OpenSSL constantly (not literally constantly, but every hour or so) sent to my Terminal mail box saying: Message 1: Subject: Cron ...
0
votes
0answers
52 views

CronTab on OpenShift

I have a robot witch updates a particular page on Wikipedia every 2 hours. I copied it to OpenShift and made a Crontab on my own computer witch connects to OpenShift via ssh and run the robot. How can ...
0
votes
1answer
185 views

How to rebuild /etc/cron.d on CentOS?

I installed an RPM on a CentOS machine that was supposed to merge its own files contained in a /etc/cron.d structure with the current /etc/cron.d. However it replaced the current contents. I believe ...
1
vote
1answer
66 views

Mailing output of cron

I have this script which I run once a month, and I want to get the output sent to my email. If I run it manually like so, then the standard output is sent to my email. ./monthly_mail.sh | mail -s ...
0
votes
1answer
3k views

How to use Crontab for a java file in linux

How can I use Crontab in Linux specifically for a Java program? I want to run a MIS Script. How can I crontab it and what should the path be?
3
votes
4answers
210 views

Does cron jobs per se represent a significant burden on a modern system?

I'd like to run a pretty simple script (is there a dir with name x in dir y if so move it to dir z–and x will only be there about once a day) every 15 seconds or so (one minute divided into 4*15 ...
0
votes
3answers
69 views

Command to run an application within a specific directory

I want to be able to type a line of command to do the following two commands that I know: cd ~/rpitwit_commands/ rpitwit This is because I want to automatically run it upon boot in crontab, and it ...
2
votes
1answer
90 views

How to run a script as soon as the week number changes?

I would like to keep my download folder sorted. My goal is to have the files of the current week in the download folder, and the older files in a folder named after week number and year (eg 2013.09, ...
1
vote
1answer
883 views

Pimp rsyslogd to have less i/o (cron, pam,…) and less logging

On my raspberry I really don't need crons and pam logging and I want to have less i/o to make the SD card life a little longer.. I have already removed cron with the second line cron.none, I'm ...
1
vote
1answer
261 views

How to respawn vpnc when it stops?

As root, I've setup a crontab rule that launches vpnc everyday early in the morning (before I arrive at my workplace). But it often occurs that the vpn stopped mid day. As a result, I have to sudo ...
1
vote
0answers
360 views

wget command not working in cronjob

here is my command : wget -c -O /home/alireza/Desktop/1.mkv http://mysite.com/myfile and here is my /etc/crontab file : SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0 2 ...
1
vote
1answer
517 views

Daily logRotate for apache at specific time

How can I execute logRotate daily at a specific time (3h30) each day? Specific details on how to do this would be appreciated. I'm on Debian.
0
votes
0answers
78 views

fcron or followup on debian wheezy (stable)

I've been using fcron for a long time on debian linux. In oldstable it is still existing fcron_oldstable. So sad in the actual stable wheezy there is no fcron_stable. Are there suggestions which cron ...
2
votes
1answer
2k views

Crontab + Ruby on Rails: /usr/bin/env: ruby: No such file or directory

I have a ruby on rails app and I need to schedule a crontab for a rake task. */5 * * * * RAILS_ENV=production /usr/local/bin/rake -f /usr/local/www/mysite-web-production/current/Rakefile ...
2
votes
1answer
904 views

Is there a update manager whitout gnome dependencies for xfce?

I'm looking a update manager for Debian Xfce. I installed xfce on a computer which will be use by laypersons. Therefore, I want another way (graphical) to launch apt-get update && apt-get ...
2
votes
1answer
177 views

output of top gets truncated to 80 columns when run by cron

I have got the following logging script: #!/bin/bash top -b -c -n 1 >> /var/log/toplog/top.log And the following record in my crontab: */1 * * * * /home/clime/scripts/toplog.sh The ...
1
vote
3answers
41 views

How to only output commands from CRON?

INPUT: * * * * * ( /path/to/foo -x ) 3 * * * * /full/path/tothing 3 3,2,4 * * * /full/path/tothing4 3 OUTPUT: ( /path/to/foo -x ) /full/path/tothing /full/path/tothing4 3 Q: How can I truncate ...
6
votes
1answer
2k views

How to change cron shell (sh to bash)?

Is it possible to make commands in crontab run with bash instead of sh? I know you can pass commands to bash with -c, but that's annoying and I never use sh anyway.
3
votes
3answers
517 views

Rsync problem with cron and no problem manually

I have a backup.sh file that launch an rsync command. This rsync is to backup my dedicated server on a RaspberryPi running raspbian. (I use keychain so I don't need to type any password etc ...) The ...
2
votes
2answers
312 views

Why are new cronjobs ignored unless crond is restarted in SLES?

I added a new cronjob with a user (SUSE LINUX Enterprise Server 9.4): # su - XXX $ crontab -e and this is what I added: * * * * * echo `date` >> /home/XXX/a.txt but the a.txt isn't ...
0
votes
1answer
131 views

Cron Job Clean Directory

How is it possible to delete files older than 14 days in a folder using a cron job? Everything I have tried so far hasn't worked.
2
votes
3answers
487 views

cron: bash syntax not working

I am trying to add following command to crontab: I=1; for X in $(/bin/ls -r /var/tmp/*); do [ $((I++)) -le 28 ] && echo "lower" || echo "higher"; done When executed on the command line (in ...
2
votes
1answer
154 views

Cronjob output to log

I'm using a script for testing broadband speed and I would like to set up a cronjob for testing every n minutes and output to a file. The command to launch it from a shell console and append to ...
0
votes
2answers
2k views

What is wrong with my cron job?

I'm new to linux, and was told I could use a feature called cron job to run a python script I made execute every 10 minutes. Problem is the the python script isn't running. There doesn't seem to be a ...
0
votes
1answer
119 views

run-parts ignores jobs.deny

I use run-parts to run all scripts under a directory,the same way crontab does. But the jobs deny and jobs allow don't block any of the scripts in the directory. rajeevs@rajeev:/home/rajeevs/test$: ...
2
votes
4answers
2k views

How to display a (zenity/GUI) dialog to the user after a root cron task has completed

I have a simple periodic cron task that must run as root. I want to use Zenity (or similar) to display a GUI informational dialog to user 1000 (or logged in user or all users) when the cron task ...
2
votes
2answers
3k views

What are the permissions of a cron job?

When a cron job runs with what privilege does it execute? I'm not sure about that. Is it with the same privileges of the user that added it via crontab -e?
7
votes
1answer
2k views

List of modified files of the past 24 hours

Is there a reliable way to have a system that mails me the list of files that were modified in the past 24 hours inside a set of directories? (like /home/*/public_html/* and /home/*/*domains/*)
0
votes
1answer
726 views

Cron does not print to syslog

I have following crontab file - # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and ...
0
votes
1answer
1k views

Cron job does not fire up after a timezone change

I've tried eliminating many of the common errors, 1) ensuring that the PATHs are available for cron 2) there is an endline at the end of crontab file 3) the timezone is set-up by: cd /etc cp ...
2
votes
2answers
310 views

command not running in cron (systemctl suspend)

I have this cronjob set : * * * * * /usr/bin/systemctl suspend And it is not working. But I can run it in a shell and it works. I don't understand what could be not working. EDIT Redirecting error ...
4
votes
1answer
667 views

How is cron scheduling actually implemented and makes sure scripts run on time?

I want to ask about cron jobs. OK, we place the scripts in the crontab and the cron daemon executes them. Now if I understand this, each minute, cron checks the crontab of each user and executes the ...
16
votes
6answers
29k views

How can I run a cron command with existing environmental variables?

How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
7
votes
5answers
5k views

Run script in a non interactive shell?

I have a cron job that is running a script. When I run the script via an interactive shell (ssh'ed to bash) it works fine. When the script runs by itself via cron it fails. My guess is that it is ...
4
votes
3answers
1k views

Cron allowed special character “L” for “Last day of the month” on Debian

I'd like to know if L is one of the allowed special characters on Debian's cron implementation? I'm trying to set up a cron to run on the last day of every month. From the cron entry on wikipedia: ...
4
votes
2answers
499 views

Cron to not run on specific day but all other days

I have a cron setup to execute a bash script daily at 10pm. I have another cron setup to run monthly on the 1st of the month. Both crons launch a bash script, and the only different in the bash script ...
5
votes
3answers
1k views

What could cause a cron to run twice at the same moment?

I have a cron that is setup to run every Monday at 1 AM 0 1 * * 1 /script/dir/script >> /script/dir/file.log After two years of running as expected, it ran twice on June 18, with the second ...
1
vote
1answer
106 views

Get system notification at a certain time?

Is there a way, in Linux or FreeBSD, to receive notification from system at a specified time? I'm thinking something in like of what inotify in Linux does for filesystem events. There IS a way to ...
1
vote
1answer
501 views

Cron automated bash script to run run 1 bash script then another, plus integrity check

So I have a custom in-house app developed by a 3rd party. When the app is running, I can verify it is running with the "screen -ls" command. As long as screens are running for rails and freeswitch ...
3
votes
2answers
459 views

setting a cronjob in IST time

I am trying to set a cronjob run in a different timezone. I've googled a lot and found editing /etc/default/cron is the way to go. But this file is deprecated and I see the following message, so I ...
5
votes
2answers
2k views

Scp doesn't work in cron

Yeah, I know it's classic. I've googled it all around, but still it doesn't work. I have the following script: #First go to SVN repo folder cd $svnrepos # Just make sure we have write access to ...