Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

Cron:

#!/bin/sh
echo "START NOW ......"
DOMAINS=""

BIGDOMAINS=""

mailadmin=""
sysemail="mailsync_script@xxx.xx.xx"
Date=$(date)
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/
done
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/
done
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .