Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have /etc/cron.d/remote-server-backup as follows:

***starts***
MAILTO="log@automatem.co.nz"
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 log@automatem.co.nz. 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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

grep -r CRON /var/log/*

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.

share|improve this answer
    
It seems the " around the email broke it. Other comments: 1) Thanks for the grep reminder, I had overlooked the CRON calls among all the other ones. 2) I had no MTA installed –  jdog Dec 28 '12 at 8:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.