Install rdiff-backup for incremental backups

Sep 27, '05 06:46:00AM

Contributed by: keaka

rdiff-backup is a free backup utility. It does incremental backups, so it is fast and bandwidth efficient. It maintains a version history, so you can easily recover a file as it existed yesterday or two months ago. rdiff-backup combines the benefits of a mirrored backup with the benefits of an incremental backup, and it works on your local machine or remote servers.

The program itself is very easy to use, but installing it on Mac OS X can be a bit tricky if you aren't familiar with building source code or installing unstable Fink packages. Instead, read on for an easy way to install it using DarwinPorts.

  1. Download and install DarwinPorts. [5.0MB direct download link]

  2. After running the DarwinPorts installer, add the following to your ~/.profile file:
    export PATH=$PATH:/opt/local/bin
    export MANPATH=$MANPATH:/opt/local/share/man
    export INFOPATH=$INFOPATH:/opt/local/share/info
    
    The lines above assume you are using a bash shell (the default in a new install of Mac OS 10.3 and OS 10.4). If the .profile file doesn't exist, create it. If you are using a C shell (OS 10.2 and some 10.3/10.4 installs that upgraded from 10.2), instead add this to your ~/.cshrc file:
    set path=($path /opt/local/bin)
  3. To load the changes you just added to your .profile, type source ~/.profile in the Terminal.

  4. Update your DarwinPorts installation to the latest version by running this command in the Terminal:
    sudo port -d selfupdate; port sync
  5. Finally, install rdiff-backup by running this command in the Terminal (this takes a few minutes):
    sudo port install py-rdiff-backup
You're all set! I use a command like this to back up my home directory to my external hard drive:
rdiff-backup /Users/MyUserName /Volumes/external_drive/MyUserName
You can also use it to make backups to/from a remove server using ssh. To recover the latest version of a file, you can just copy it back over from the backup directory. To get an older version of a file, for example as it existed 10 days ago, you can do this:
rdiff-backup -r 10D /Volumes/external_drive/MyUserName/file \
/Users/MyUserName/file
[robg adds: I installed DarwinPorts and rdiff-backup on my PowerBook, which went well. The selfupdate and port sync commands, however, failed (message: "invalid gid nobody"). I'm trying to get to the bottom of that, and I'll post an update here if/when I do. Nonetheless, the rdiff-backup install went just fine (though the compile is time-consuming!), and a test backup of my user's home folder seems to have worked perfectly.]

Comments (22)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050924172511686