Finally, encrypted, fast offsite backups

If you’ve been reading my ramblings for a while, you will remember that I have been looking for a good way to back up my files, without much luck. My requirements are:

  • Encrypted (on the original machine).
  • Fast/bandwidth-efficient (deduplication is a plus).
  • Open-source.
  • Cheap.

My files are mostly code and photos, which aren’t really critical (the critical files are stored in repositories and multiple computers), but losing all my photos wouldn’t be too great. That’s why any backup solution I wanted had to be cheap enough to justify the cost.

Every single piece of software I have ever tried fails in at least one of the above. I currently use SpiderOak, which is everything except open-source, so that fails too.

However, my quest is finally over. I have discovered the Holy Grail of backups, and its name is Attic. I don’t know how it took me this long to find, but there you have it.

UPDATE: I have now switched over to Borg, which is a fork of Attic that seems better-maintained. This article still mostly applies to Borg, though

Attic

An atticMuch nicer than this

Attic is an open-source, encrypting, deduplicating backup manager. This means that all your data is securely stored on a remote server, while only new data is transferred every time you create a backup. The fact that it’s open source means that it’s easy for people to audit for vulnerabilities, or for things that don’t make sense.

Using Attic is very easy. The quick start guide details all the usage instructions, so I won’t replicate them here, but the quick rundown is that you initialize a repository on a server (local or remote) and then start creating archives. Since Attic is deduplicated, it will only transfer files that don’t exist in the repo, saving you time and money.

Storage

Backup programs are great, but where does one actually store the files? SpiderOak is around $90/year for 100 GB, but everything else is pretty expensive (except S3, which Attic can’t easily support). Luckily, though, I found a provider called RamNode, which provides 90 GB of space for less than $3 per month. I got an account with them and started storing my Attic backups, and I’ve been very satisfied so far.

You can’t really beat the peace of mind this provides you for around $30 a year. My only concern was with bit rot, as I didn’t want to suddenly find that my provider’s hard disk had some bad sectors, making my backups unreadable. Fortunately, Attic has a solution for that, with its attic check command. attic check checks your repository’s files, making sure the checksums of the files match what is actually stored on disk.

Another consideration when selecting a backup program is the ease of keeping multiple backups. I don’t want to keep daily backups for ever, but I do want to keep a few from a few months ago, in case I delete something and don’t notice for ages. Fortunately, Attic has thought of that too, and allows you to keep as many daily/weekly/monthly/yearly backups as you want. For example, you could say that you want 7 daily backups (for the last week), and 4 weekly ones (for the last month). That would get you one backup per day in the last week, and one backup per week in the last month. Pretty handy!:

attic prune $REPOSITORY --keep-daily=7 --keep-weekly=4 --keep-monthly=6

Restoring files

Attic is great when restoring files as well. It doesn’t just allow you to restore the entire backup or single files, but it allows you to mount the backup as a filesystem so you can browse it and copy single files out of it! That is magical, and is one of the features that made me fall in love with it. It allows me to go back to a point in time and restore files from it in a very natural way, as if my old filesystem were just there:

attic mount /data/myrepo::root-2013-08-02 /tmp/mymountpoint

Epilogue

If you have any data you want to store offsite (which you should if you have any data at all), give Attic a try. It’s perfect for my use case (lots of non-life-and-death photos), and it really shines for backing up any sort of data.

If you have any other recommendations, or have been using Attic and are happy/unhappy, please leave a comment below, or I will also be expecting your comments below, or Tweet at me. I’m especially interested in hearing from people who were unsatisfied by it, as those are generally the most interesting experiences, especially when it comes to backups.