Easy backups with Obnam

Slashdot it! Delicious Share on Facebook Tweet! Digg!

First Backup

You can start the first manual backup of the entire home directory with the following command:

$ obnam backup $HOME

This step assumes that you've already mounted the backup target and that you're running the console from that directory. Alternatively, specify the target of the backup with the -r option or set it up in the configuration.

You trigger the next backup in the same way. This step backs up all new and modified files. With larger backups, such as the initial one, you risk losing the connection – especially if you're going over a wireless LAN. To address this, the program adds a marker every 100MB and resumes its work when the connection comes back up.

Obnam is quite fast at doing its work. In my test, the 61GB home directory backup took 37 minutes with a USB3 connection. After completion, the software reported with a message from the first line in Listing 2. A second run a few days later returned the message from the second line – the program was a good half hour faster the second time around.

Listing 2

Backup Report

$ Backed up 98627 files (of 98628 found), uploaded 61.0 GiB in 37m18s at 28.1 MiB/s average speed
$ Backed up 4633 files (of 101010 found), uploaded 3.0 GiB in 3m24s at 15.1 MiB/s average speed

To control how many backup generations you've created or retained, use the obnam generations command. Listing 3 shows the results for the backups in Listing 2.

Listing 3

Backup Results

5543    2014-04-27 19:52:12 .. 2014-04-27 19:59:35 (98628 files, 69491282768 bytes)
6751    2014-05-01 09:42:39 .. 2014-05-01 09:43:20 (101010 files, 71257775259 bytes)

Divide and Conquer

In rare cases, you might be backing up the entire home directory. The procedure for the selection or inclusion of certain files depends on what's faster to define. If you want to back up only five directories, it makes sense to determine that with the backup commands or in the configuration.

It's more likely that you'll want to exclude individual directories or files from the backup. You can do this with the --exclude parameter that you can use on the command line, or, better yet, write into the configuration. It's also possible to exclude temporary storage with exclude-caches = yes or externally attached filesystems or the virtual proc directory with one-file-system = yes .

When backing up to the Internet, you can use the option to encrypt with GnuPG, which assumes that you've installed the GnuPG agent and generated a key pair. You can do so as user with the gpg --gen-key command. The GnuPG home page provides instructions on how to set up your keys [10].

Each key has an identifier, which the software uses when creating the key pair. The identifier appears in the list when you call up the information on the stored keys with --list-keys . You enter the identifier in the configuration with the following lines:

encrypt-with = "<identifier>"

That's all it takes to set up encryption.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content