-   Linux - Server (
-   -   Root cron not working (

rijo79 02-25-2017 12:18 PM

Root cron not working
Hey guys. I've set up two cron jobs under root to do daily incremental and weekly full backups to an S3 instance and then send an email when complete. The email is sent to root@localhost and I have postfix config'd to forward root's mail to a virtual user. If I copy and paste them into a terminal, the commands work perfectly. However the cron jobs do not run at 3 am as they are supposed to. I'm stumped. Don't know why this isn't working. Here are the output from crontab -l:


00  03  *  *  1-6  /usr/local/bin/ && /usr/bin/duply srv1-bak backup && echo "Daily incremental backup for `date '+%d-%m-%Y'` complete at `date '+%H:%M:%S'`" | /usr/bin/mail -s "Backup complete" root@localhost
00  03  *  *  7  /usr/local/bin/ && /usr/bin/duply srv1-bak full && echo "Weekly full backup for `date '+%d-%m-%Y'` complete at `date '+%H:%M:%S'`" | /usr/bin/mail -s "Backup complete" root@localhost

Any pointers would be much appreciated.

michaelk 02-25-2017 12:32 PM

The % is a special character with cron and needs to be escaped i.e. add a \ before.

rijo79 02-25-2017 02:03 PM

That did the trick. Thank you very much.

michaelk 02-25-2017 02:35 PM


You can mark the thread as solved via the thread tools pull down menu at the top.

All times are GMT -5. The time now is 11:26 AM.