For a long time, rdiff-backup has been my preferred backup solution. Recently, however, I started looking for an alternative because its performance simply was not up to par any more–it took over 20 minutes to process my home directory although less than 1 MiB of files had changed.

Luckily, I stumbled over Obnam. Joey Hess already adopted it as an additional backup solution, so I figured I could give it a try as well. And I was pleasantly surprised: Configuration is very easy, the backup is sufficiently fast, there's support for GPG-based encryption, and it offers deduplication. What's not to love?

So, my current backup setup for my laptop has a central .obnam.conf configuration file with the following content:


repository = sftp://example/home/example/

exclude = \.o$, \.tmp$, /Trash/, ...

Of course, the exclude list is a tad longer in reality. This is the only tedious thing about Obnam: All excluded files and directories have to be specified as a regular expression in a single line. I have several folders I do not wish to be transferred, such as caches, downloads, temporary storage, and the like. For each of these folders, I either added a /foldername/ or the full path to the exclude line so that Obnam does not include for regular backups. Here are some recommendations for stuff to exclude:

  • \.o$
  • $HOME/.cache
  • $HOME/.thumbnails
  • /build/
  • /Downloads/
  • /Trash/
  • A variety of auxiliary files for LaTeX sources, temporary backup files for editors, and so on

With a sufficient exclusion list, I was now able to do backups quite comfortably using obnam backup $HOME. But there's more: Since the backup usually does not take very long, I decided to let it run automatically. I created a small shell script for this:


notify-send "Starting obnam backup..."

obnam backup $HOME 

if [ "$?" -ne 0 ]; then
  notify-send "Unable to finish obnam backup."
  exit 1
  notify-send "Finished obnam backup."

notify-send is a nice little program that allows scripts to send notifications to a window manager. Both awesome and GNOME 3 show small notification bubbles for a small period of time. Finally, I added an entry to my personal crontab, instructing Obnam to run every day at 8 o'clock in the evening:

0 20 * * * DISPLAY=:0 /home/example/backup

Note that the DISPLAY=:0 variable is required so that the notifications of the script are shown. For systems that are only powered on sporadically, it might also make sense to create a configuration for anacron. So far, the normal cron variant served me well, though.

If you want to use the script yourself, you might want to incorporate a more powerful logging and notification capability in case Obnam does not complete its run. For my own use (and for now), I am content with checking the backup generations created by Obnam using obnam generations every once in a while.