Easy backups with Obnam

Slashdot it! Delicious Share on Facebook Tweet! Digg!
Haloocyn, freeimages.com

Haloocyn, freeimages.com

Lucky Strike

The Obnam command-line tool allows backups and restores, even when the X server is on strike. Its many options will easily meet the needs of a SOHO environment.

Hard drives know only three basic states, empty, full, and broken. In the first two states, the devices store data. However, hardware can change to the third state more often than you might like. So, unless you're following the Torvalds principle of "real men don't do backups," you will sooner or later need a good backup strategy and the right software to go with it.

The number of programs available for backing up data is astounding [1]. The Obnam tool, however, stands out from the crowd thanks to its many options that, in most cases, help ensure that your data is securely backed up. The excellent online tutorial [2] assists in special cases.

Obnam was written by the Finnish Debian developer and Linux old-timer Lars Wirzenius. He's been working since 2006 on Python software that stores desired backups on local disks, NFS or SMB shares, or remote servers, supported by the SFTP protocol.

Playing It Safe

Most backup tools are based on the rsync [4] algorithms, which provide the most important feature in backup software: the incremental backup. This approach involves backing up just the deltas since the last full or incremental backup.

This method therefore does therefore require a complete backup from time to time, which can consume both time and bandwidth if transferred over the Internet. Restoring is also labor-intensive because the data is usually composed of multiple incremental backups. The alternative of a differentiated backup, which always saves the changes from the last complete backup, requires more storage.

When Lars Wirzenius created an online backup service in 2006, these approaches didn't appeal to him, as he announced in the release notes for version 1.0 of Obnam in 2012 [5]. Instead, Wirzenius implemented the copy-on-write function, COW [6] for short, which is also used in Btrfs for creating snapshots.

The block-based approach, which allows the snapshot function in Obnam, is distinctly different from many other backup systems and is much closer to professional high-end products with "near-continuous data protection" (Near CDP) [7].

The software reuses already existing identical blocks, even when they're in different files or an older backup. The process is called deduplication [8]. Thus, each Obnam backup is a full backup, even when in theory it's an incremental backup.

Got Your Back

What sounds like a complicated process is quite simple in practice with Obnam – so much so that the tool doesn't even need a graphical interface. If it did, the many options would either overburden it or render it inadequate. (See the "Lucky Backup" box for an alternative tool.)

Lucky Backup

An alternative to Obnam with a graphical interface for home use is the Qt framework-based Lucky Backup (Figure 1) [14]. This application does its job in the background with rsync, so the backups fail somewhat more frequently than they do with Obnam. Beginners might find it a bit easier to use, however.

Figure 1: Lucky Backup is an alternative for users who don't feel quite comfortable with command lines.

Thanks to the comprehensive documentation, the program can serve your everyday needs. You can generally configure the software in less than half an hour. After that, it is set up to do its work on demand completely automatically. Additionally, Obnam gives you the option of initiating backup and restore operations from the command line.

The installation on Ubuntu can be carried out with the following simple command:

$ sudo apt-get
  install obnam

It copies less than 5MB of data onto the hard drive. For Debian, Gentoo, and openSUSE, packages are ready for download along with the source code [9]. For most scenarios, a configuration file makes the most sense. You create a text file for it as user with the command touch ~/.obnam.conf in your home directory. Listing 1 shows sample content.

Listing 1

Configuration File

# Backup storage
# Log file storage
log = /home/Username/obnam.log
# Log level
log-level = info
# Maximum log file size
log-max = 100 mb
# Backup exclusions (file types, downloads folder)
exclude = .mp3$, .mp4$, .part$, .rar$, .nfo$, /Downloads$
# Excluding caches
exclude-caches = yes
# Excluding external filesystems (/proc, NFS, etc.)
one-file-system = yes
# Keeps a daily backup over the last 14 days, etc.
keep = 14d,10w,12m
# Encrypts using GnuPG
encrypt-with = "My ID"

Note that to back up the root filesystem or parts of it, I recommend keeping a separate configuration file that includes a line such as root = /etc, /var , which backs up in the appropriate locations.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content