Rsync Email As Backup Issue

Shane3673

Well-Known Member
Dec 20, 2013
96
1
58
cPanel Access Level
Root Administrator
I've used this cmd before to rsync all mailboxes using a cron job, but after setting up a new server I can't seem to get it to work. Here is the command:

fox x in $(cat /userlist.txt); do rsync -vrlptgDuo --delete /home/$x/mail/ [IP]::[Share]/home/mail/$x/mail/ ;done

It works fine on every other CentOS 6 machine I have used it on, but this is what I am getting on this one and I can't find any useful info on Google:

-bash: syntax error near unexpected token `do'

I use it as a every 5 minute cron job so I have a backup of all mail up to 5 minutes back.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
fox x in $(cat /userlist.txt); do rsync -vrlptgDuo --delete /home/$x/mail/ [IP]::[Share]/home/mail/$x/mail/ ;done
Hello :)

You have "fox x" instead of "for x" in this bash command.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Not a problem! A third-party perspective is often useful for those types of oversights.

Thank you.