How To Backup / Rsync all your data to Bluehost

Last Saturday I ordered a new domain name at bluehost : http://www.wijndaele.com

Why Bluehost (Red marked = The most important for me) :

And this for (only) 60 €/Yr. (96$/Yr) :-)

Because they offer unlimited hosting space I decided to start backing up al my files from my NAS to “my webspace“.

And since you have ssh access , you can use rsync (or something similar)

First I enabled SSH access on my nas. Then I enabled public-key authentication (How To) on my wijndaele.com account. When that was done I wrote the following script (combination of scripts I found on inet) and I placed it on to my NAS :

# This script does personal backups to a rsync backup server.
# directory to backup
BDIR=/volume1/photo/
# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=/volume1/NetBackup/backup.exclude
# the name of the backup machine
BSERVER=YOUR_USERNAME@YOUR_IP
TODAY=`date '+%Y-%m-%d'`
# remote directory where we would like to backup our data to
RBDIR=/BACKUP
#####################################
#####################################
OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES
--delete --backup --backup-dir=/$BACKUPDIR -avz"
# now the actual transfer
rsync $OPTS $BDIR $BSERVER:$RBDIR/current
ssh $BSERVER 'touch /BACKUP/current ; cp -al /BACKUP/current/* /BACKUP/`date '+%Y-%m-%d'` ; exit';

As you can see this is a small script that creates for every day a new subdir on your /BACKUP directory. Also at any time you can find the latest backup in  the following directory : /BACKUP/current

And If you may wonder about the last step :

ssh $BSERVER 'touch /BACKUP/current ; cp -al /BACKUP/current/* /BACKUP/`date '+%Y-%m-%d'` ; exit';

Here is some more info about it :

Download here the backup script : backup.sh

Comments

One Response to “How To Backup / Rsync all your data to Bluehost”

  1. Adam on November 17th, 2009 10:59 am

    Just be aware that backing up personal files to their servers is against their terms of service (UNLIMITED Hosting Space not disk space), so if they catch you they will probably delete all your files and suspend your account.

Leave a Reply