The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rsync Email As Backup Issue

Discussion in 'E-mail Discussions' started by Shane3673, Apr 12, 2016.

  1. Shane3673

    Shane3673 Well-Known Member

    Joined:
    Dec 20, 2013
    Messages:
    96
    Likes Received:
    1
    Trophy Points:
    8
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

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

    Thank you.
     
  3. Shane3673

    Shane3673 Well-Known Member

    Joined:
    Dec 20, 2013
    Messages:
    96
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hahaha,

    Man do I feel stupid right now.
    You have no idea how many times I read through that over and over and didn't notice.
    Thanks.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page