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.

Remote backups?

Discussion in 'General Discussion' started by DeepXP, Mar 12, 2009.

  1. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Hi,

    I just wanted to get some opinion on remote backups, I personally feel the default option in WHM might reveal the FTP password. Are you guys aware about any good method? I checked few service providers but they are way too costly, the backup costs reach around 100 USD a month, which is somehting does not fit well.

    I checked Mosso CloudFiles can be used for backup.

    Anyone tried it? I found this script online (to backup data on Mosso CloundFiles on daily basis) but not sure about it..

    Would like to hear some views on remote backups.

    Regards,
    Deep
     
  2. conchur

    conchur Member

    Joined:
    Apr 9, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I use rsync to synchronise to another server over SSH using pre-generated keys for authentication.

    The rsync command I'm using is this:
    rsync -az -e "ssh -p 22 -i /backup/rsync/.ssh/rsync-key" /backup/cpbackup rsync@REMOTE_HOST:/backup/rsync/LOCAL_HOST

    This will copy the entire backup file-structure (daily, weekly, monthly, all accounts and system settings) to a folder on the remote host.

    I've added the following cron script (after setting the variables to my particular setup) as /etc/cron.daily/rsync_backup:

    #!/bin/sh

    RSYNC=/usr/bin/rsync
    SSH=/usr/bin/ssh
    PORT=22
    KEY=/home/thisuser/cron/thishost-rsync-key
    RUSER=remoteuser
    RHOST=remotehost
    RPATH=/remote/dir
    LPATH=/this/dir/

    $RSYNC -az -e "$SSH -p $PORT -i $KEY" $RUSER@$RHOST:$RPATH $LPATH

    And then used crontab -e to set this to run every morning at 5am by adding this line at the end:
    0 5 * * * /etc/cron.daily/rsync_backup

    All done, and tested! Hope this helps someone else.

    (originally posted in response to a thread on webhostingtalk, and largely based on a script I found online but can't find a link for now)
     
  3. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Thanks a lot, I will give this script a try.. :)
     
Loading...

Share This Page