DeepXP

Well-Known Member
Feb 20, 2005
67
0
156
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
 

conchur

Member
Apr 9, 2007
6
0
151
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 [email protected]_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" [email protected]$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)