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) :
- UNLIMITED Hosting Space (NEW!)
- UNLIMITED File Transfer (NEW!)
- 2,500 POP/Imap Email Accounts
- SSH (Secure Shell), SSL, FTP, Stats
- CGI, Ruby (RoR), Perl, PHP, MySQL, PostgreSQL
- Free Domain Forever!
- 24/7 Superb Support
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_IPTODAY=`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/currentssh $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 :
- I create a remote ssh connection to wijndaele.com (ssh YOUR_USERNAME@YOUR_IP)
- I touch /BACKUP/current , that way I know when the last sync took place
- cp -al /BACKUP/current/* /BACKUP/`date ‘+%Y-%m-%d’` : I create a hard link from all the files in /BACKUP/current/* to the Dir of that day (eg /BACKUP/2008-08-04)
- When all that is done, I simply close the remote connection!
Download here the backup script : backup.sh
Comments
One Response to “How To Backup / Rsync all your data to Bluehost”
Leave a Reply
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.