I have /etc/cron.d/remote-server-backup as follows:
***starts***
MAILTO="[email protected]"
23 1,7,13,19 * * * root /usr/local/bin/backup-server nzs1.automatem.co
43 2,8,14,20 * * * root /usr/local/bin/backup-server nzs2.automatem.co
***ends***
The script is custom written and performs an incremental backup with rsync.
I'm finding that nzs2.automatem.co script runs every 6 hours, the nzs1.automatem.co script runs never. I don't get any emails on [email protected]. When I run from command line nzs1.automatem.co, it performs the backup correctly.
My Environment is Ubuntu 12.04 LTS.
How can I get the first line to run automatically?
Edit: From the comments, the problem was caused by the
""
around the MAILTO: email address.There is nothing obviously wrong with the crontab you show providing that the
***starts***
and***ends***
aren't really in it.It's not normal to see
""
around the email address so you could try removing them.Next check your logs for any relevant information. You don't say which OS or distro you're using but /var/log/cron (RHEL based), /var/log/syslog (Debian based) but they could be elsewhere.
If the logs don't indicate a problem and the
/usr/local/bin/backup-server
script is seen to be run they your problem lies within it so you'll have to break out your script debugging skills.