rdiff-backup, another one of those tools you come by and wonder why you've not seen it before. I've lived through all manners of ssh+rsync+tar to handle remote system backups and incremental changes with varying degrees of success. rdiff-backup is beautiful because it is powerful yet so easy to work with. Just install the same rdiff-backup package at both source and destination ends and everything then just works.
rdiff-backup simply uses ssh for file transport so provided you can ssh to a machine you ought to be able to back it up. rdiff-backup provides:-
- remote system backup via ssh.
- rsync like efficiency.
- easy incremental change management.
- easy ability to purge old incremental data.
- easy ability to tarball snapshot images to store offsite.
The use case of taking daily backups of every system storing on a massive filesystem and tarballing weekly snapshots for offsite storage is now a much simpler task.
There is one exception you may encounter (as I did) and that is different rdiff-backup versions are not always capable of working with one another even with minor version changes (for example 1.1.5 will not work with 1.1.16). This becomes a hicup in situations where one has a variety of systems to deal with at different Linux distribution stages. In the world of Debian/Ubuntu this means you may not be able to simply type apt get install rdiff-backup across all your systems and that you may have to do a little extra work.
Installing rdiff-backup from package tarballs is dead simple simple once the required libraries are available and can be confirmed to work across Ubuntu releases, dapper (6.04) through intrepid (8.10).
To get started, head over to the rdiff-backup site and grab yourself a recent copy (Version 1.2.5 at time of this writing).
Step 1 - make sure you have the requisite packages and libraries installed
apt-get update
apt-get install python-dev librsync-dev gcc
Step 2 - untar the package you just downloaded
tar -zxvf rdiff-backup-1.2.5.tar.gz
Step 3 - install the package
cd rdiff-backup-1.2.5
sudo python setup.py install --prefix=/usr/local
You'll notice I added the the --prefix=/usr/local to the python setup, this has the effect of installing the rdiff-* tools into /usr/local/bin which I find desireable.
Step 4 - establish a password-less ssh key
This recipe calls for generating password-less ssh keys that get used on the source machine (ie. machine being backed up) root account. I can't underscore enough how important it is to protect the target machine that stores the private part of the ssh key. In general you should be considering operating a sole purpose machine (or perhaps virtual machine) who's job is just to deal with backup and has very limited access. Protecting this backup machine like gold becomes an easier task since you need no network facing daemons on this host if you have physical console access.
Step 3 - perform your first backup
First up create a path on your target machine where you will store all the source machine files, for example you might choose /opt/backups/source.hostname
Lets do the backup, from the target host do the following:
/usr/bin/rdiff-backup \
--exclude /tmp/'*' \
--exclude /var/tmp/'*' \
--exclude /mnt/'*' \
--exclude /proc \
--exclude /sys \
root@source.hostname::/ /opt/backups/source.hostname
That might take a while depending on the link between the source and target machine and the volume of data to be transferred.
You can now install that command line into a crontab and you've got nice easy rdiff-backups, done and dusted.
N

Post new comment