SteveManC
SteveManC

Reputation: 132

cannot get cron job to install

I have a simple cron job that I would like to run at 3am each morning. For testing purposes, I have set it to run every hour at the 15th minute like so-

15 * * * * * java -jar /home/scarter/scripts/java/autobackup.jar

I use crontab -e to open the editor, place this line in and save, but I get this error- "/usr/bin/crontab: installing new crontab "/tmp/crontab.XAv3xa":1: bad command errors in crontab file, can't install." I am not sure what is wrong here, I have been pouring over anything I can find on cron but all seems right in this line. Thanks for any help.

Upvotes: 0

Views: 150

Answers (1)

Benjamin Lücking
Benjamin Lücking

Reputation: 136

You have to delete one asterisk. It should be

15 * * * * java -jar /home/scarter/scripts/java/autobackup.jar

because a cronjob is defined as:

minute (m), hour (h), day of month (dom), month (mon) and day of week (dow)

and the desired command that you wish to be executed.

Upvotes: 1

Related Questions