Offsite Backups
Like with most people I don’t do regular backups, and at best I only copy it to another hard disk. This has proved sufficient in the past and I haven’t lost a serious amount of data. In fact I can probably dig up every email I’ve sent and received in the past decade. Part of the neglect is that I was just shuffling data between PCs in one room, so that only really covers me against hardware failure. Fire and theft, I’m screwed.
Why am I thinking about backups again? A couple of things. First was my recent hardware issues, for a while I thought about scrapping my desktop and only being left with my laptop. I’d also like to make the desktop into a media PC and could use every ounce of disk space. There are several gigs of backup living on it that could be better used for a hard disk recorder. This would make my laptop the only copy of my data, I’m not comfortable with this, a laptop is fragile and prone to theft. If I was to make it my only PC I’d need proper backups. The second thing is the proliferation of online storage companies. Now there’s a viable place to store things offsite.
But why pay for something I already have? With DreamHost I have 26GB of storage and 1TB bandwidth a month doing nothing. Time to put it to use.
The tool I chose to use it rsyncbackup. It’s a perl script that lets you define various sets to be backed up, specify several destinations and have them backup at different times. At first the config files can be a little confusing but they’re reasonably well documented. Here are my test configs (the default config files have more detailed examples):
backupset.conf
[default] test|test|true|
destinations.conf
test|ssh[key=id_dsa]:user@host:~/backup/laptop|true|
sources.conf
################## # SOURCE FILE ################## # This file includes all sources # Syntax: # tag|path|conditionalShellCode|rsyncoptions test|local:/home/miles/test|true|-a
Then you can run it with:
rsyncbackup -b
N.B. This assumes you’ve got a ssh key pair and you’ve setup your remote server to accept it. If your key has a password, you’ll also need to be running keychain to automate this process.
One slight hitch I encountered was that it wanted the executable and all the config files to be in a directory called ‘backup’ in your home directory rather than in the directory structure in the zip file. A quick glance shows it’s hard coded in the script, that can be sorted out later.
The test run went smoothly so I’ll try it with some chunkier data. But I think for most of the data I’ll bzip2 it copy it over manually to prep the backup directories. No point it letting it take longer than it should. Another hiccup I can see is that my current wifi driver (hostap) doesn’t like large transfers, i.e. it has a habit of dying if you copy a large file. But this was only locally and maybe the bandwidth restriction of my ADSL line will keep it alive. If it fails I can always fall back onto ethernet.
