Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My rsync cron job does not run at the expected time and below are my scripts. It gives me the error:

crond[9231]: unable to create mail file /var/spool/cron/cron.YSwg8Z/cron.root.9290: cron output for user root /usr/bin/run-parts /etc/cron.hourly 1> /dev/null to /dev/null


echo "START NOW ......"


start_date=`date +"%d-%m-%Y %r"`
for domain in $DOMAINS; do
    rsync -arv --delete /data1/popmail/$domain/ -e ssh root@xxx.xx.xx.xx:/data/popmail/$domain/
sleep 10
for bigdomain in $BIGDOMAINS; do
    rsync -arv --delete /data1/popmail/$bigdomain/ -e ssh root@xxx.xx.xx.xx:/data/popmail/$bigdomain/
end_date=`date +"%d-%m-%Y %r"`
echo "Backup for all Email Domains Started at $start_date and Completed at $end_date. " | mailx -r $sysemail -s "Backup Successful on $Date" $mailadmin

Error :/usr/local/scripts/WSdomainsrsync: line 20: syntax error: unexpected end of file

Could somebody help out on this

share|improve this question

There's no done to close that second (bigdomain) for loop.

I'm guessing you meant to place the done after the rsync command.

for bigdomain in $BIGDOMAINS; do
    rsync -arv --delete /data1/popmail/$bigdomain/ -e ssh root@xxx.xx.xx.xx:/data/popmail/$bigdomain/
share|improve this answer

Your Answer


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.