0

So I created a cron job as shown below:

  GNU nano 2.2.6                    File: /tmp/crontab.uNoEXy/crontab

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
*/3 *  *    *   *    /home/kyle/runBackup.sh

Which, for a test - runs the script as indicated every three minutes. Yes checking the var/log/syslog - there is no cron run for today. evidence of this cron running is a .tar.gz file in my dropbox folder - which, if you run the script your self, happens. Its only putting it into a cron that nothing happens.

0

2 Answers 2

0

Try with:

*/3 * * * * /home/kyle/runBackup.sh

A CRON expression is a string comprising five or six fields separated by white space

For details see: http://en.wikipedia.org/wiki/Cron

9
  • Updated OP: Still nothing Oct 30, 2013 at 18:13
  • You need also to have a new empty line after that cron rule (just type an enter). Do you have it? Oct 30, 2013 at 18:15
  • Also you are sure about the full path of runBackup.sh? Oct 30, 2013 at 18:18
  • I have two empty lines after. The script is stored in /home/kyle/ so yes ... Unless there should be more before home Oct 30, 2013 at 18:18
  • Can you post your script on paste.ubuntu.com ? Oct 30, 2013 at 18:25
0

I had a very similar issue and noticed that after the job was scheduled to be run mail was being placed in /var/spool/mail for root, it is the root crontab that the job was placed in, saying that the root user did not have permission to run the job. Did some looking around and it turned out to be due to the target script not being executable. If you do:

ls -la /home/kyle/

and the runBackup.sh shows -rw-r--r-- permissions then try:

chmod +x /home/kyle/runBackup.sh

which should make the permissions -rwxr-xr-x and allow the job to run.

Source Material

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .