Non-random thoughts.

2009-02-21

Setting up rdiff-backup 1.2.5 on Ubuntu Hardy 8.04

I wanted to backup a server running Debian Lenny 5.0, to a slightly older box running Ubuntu Hardy 8.04 using rdiff-backup. As rdiff-backup complains if the version-numbers on both sides are not the same I had to upgrade the older box to version 1.2.5 of rdiff-backup.


aptitude install librsync-dev python-dev
tar xzvf tar xzvf rdiff-backup-1.2.6.tar.gz
cd rdiff-backup-1.2.6
python setup.py install --prefix=/usr/local


I have previously used standard rsync for efficiently mirror the contents of a server to the backup server. This meant that I also had to change my backupscript slightly, to accomodate rdiff-backup usage.


#!/bin/sh

EXCLUDE="/var/lib/mysql/ /tmp/ /proc/ /sys/ /dev/ /bin/ /sbin/ /lib/ /usr/"
INCLUDE="/usr/local/"

exclude=""
for i in $EXCLUDE; do
exclude="$exclude --exclude $i"
done

include=""
for i in $INCLUDE; do
include="$include --include $i"
done

# rsync --archive --delete --sparse $exclude $include --rsh=ssh / backupuser@backupserver:root
rdiff-backup $include $exclude / backupuser@backupserver::/home/backupuser/rdiff-backup/