What am I doing wrong here? Trying to set a cron job to run a shell script but it won't work. I entered the below after doing crontab -e
. It does show up when doing contrab -l
.
0 2 * * * root /root/localbackup.sh
What am I doing wrong here? Trying to set a cron job to run a shell script but it won't work. I entered the below after doing crontab -e
. It does show up when doing contrab -l
.
0 2 * * * root /root/localbackup.sh
You're using the crontab format that's used for /etc/crontab. For the user crontabs you don't need to specify the user
0 2 * * * /root/localbackup.sh
should run.
Answering the commants
The output from vi is normal, crontab will copy it to the correct location
0 2 ... &>/tmp/mylog.log