Quick and Easy Remote Backups

I backup my database, website, and my home directory on a daily basis to a remote server via SSH and rsync. Rsync is a tool that synchronizes directories. I also use it for grabbing current copies of slackware-10.1 and slackware-current.

It’s really easy to backup files to a remote server with these tools. I create tar archives of my needed directories and store the current ones in /opt/backups. I’ve made various bash scripts to do this on a daily basis for me automatically. After that’s complete, the code shown below is run. It transfers my /opt/backups directory to the remote server. It’s path on the remote server would be /home/tyler/backups. All you need to do is set the SERVER varaible to the hostname of the server you’re backing up to.

rsync -avz --partial --delete --bwlimit=25 --progress --stats -e ssh 
/opt/backups tyler@$SERVER:/home/tyler/

The hardest part is finding a remote server that you’re able to backup to. If you’re lucky, your web host will allow you SSH access. There’s no need for the server end to have rsync installed. All it needs is SSH. I know BlueHost gives account holders SSH access. They’ve been hosting our sites at work for a while now and promptly gave me an SSH account. Their sites said they’d need an ID, but they didn’t require one from me for one reason or another. I backup to a freinds Linux box that’s located in a datacenter somewhere.

  • Stephen Gilbert

    I’m interested in backing some machines up to my Bluehost account. Can you tell me how to do this without Bluehost running the server-side rsync? I’m used to doing something like:

    rsync -av /cygdrive/c/ @::backup

    with a different server, but this doesn’t work with Bluehost.


  • Pingback: Wrapping Text Inside Pre Tags at T. Longren()

  • This tool is handy and useful, I will write some artical about it for my visitors.