Thursday, December 10, 2015

Installing borgbackup under Ubuntu Gnome

My favorite file-level backup tool for Linux (or OS X or Cygwin) is still borg (a.k.a. borgbackup).  The features that I rely on are:
  • Efficiency when dealing with millions of files, borg is very fast at scanning the file system and figuring out what needs to be backed up.  In the past, I've run it against an IMAP mail server file system with a few million files and about 100GB.  Each snapshot would only take 15-20 minutes instead of a few hours for some other solutions.
  • Very few files created on the target file system.  Other solutions like rsnapshot or rdiff-backup will turn 1 million source files into 10 million backup files (or worse) due to how they implement snapshots.  While it's useful to be able to browse the backup directory just like the source file system, it causes all sorts of issues for disk performance or copying backup directories off to removable media.  In contrast, borg creates only a few dozen or few hundred files per snapshot.
  • Deduplication using variable block sizes.  This is a huge win if you have a lot of files where parts of the files are identical.  The algorithm in borgbackup will find those identical sections and only store them once in the backup repository.
  • Efficiency over the network.  For the most part, as long as borgbackup is isntalled on both the source and destination systems, borg is very good at sending the least amount of traffic over the wire. With variable block deduplication, it's going to be more efficient then other file level deduplication solutions.
  • Built-in client-side encryption.  While I don't use this (my backups are stored on LUKS encrypted file systems), this could be useful if you are backing up to a destination server that you do not trust 100%.
  • Compression of backup data prior to transmission to the repository server.  This also helps reduce the size of the repository on the target server.
  • Works over SSH (as does rsync, rsnapshot, rdiff-backup).
Onward to getting things working under Ubuntu 15.04 (64bit, Gnome edition).  I prefer to use the pip3 install method as I have had the most success with that.

$ sudo apt-get install libssl-dev liblz4-dev libacl1-dev
$ sudo apt-get install python3-pip
$ sudo pip3 install --upgrade borgbackup

That should be all of the packages you need in order to use borg for backups.

No comments: