Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

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.