Duplicity – Pleasure and Simplicity in Your Backups

Update 2016-02-13: I’m now making use of Duplicity’s “–full-if-older-than” backup option and the “remove-all-but-n-full” clean up mode to keep a moving window of 3 months of backups. This way your backups don’t keep growing and growing. I’ve updated the examples in below.

Duplicity – Pleasure and Simplicity in Your Backups

If you’re like me, you’ve spent a long time, in many different configurations, trying to come up with a simple yet flexible, easy to use yet space efficient backup solution for a long, long time. Well, I think I’ve finally jumped ship from shell scripts and tarballs to duplicity: bandwidth-efficient backup using the rsync algorithm. Although duplicity talks up encryption, and it’s great and makes it easy, it’s not required and I don’t use it. Here’s some tips and tricks to get you started…

Before we get into duplicity, I’d like to state my personal goals with backup. It’s relatively simple and yet if you’re a system admin of any vintage you know how maddening it can be to come up with the perfect backup script. I’ve gone from dead simple 7 day rotations to complicated programs with their own opaque backends. The good news is duplicity allows me to write a simple shell script in the way that I want to write it and it takes care of all the rest of it like archiving, compressing, incremental backups, etc. What’s better still is it has easy commands to do things like: full backups, incremental backups, status of your backups, file lists, extraction, efficient extraction of specific files (Woohoo! No more 3 hour waits while you’re 6GB tarball decompresses when all you wanted was one folder!), verify/diff backup against source, clean up old backups with an age argument, using or not using encryption, and efficient rsync local and remote copying.

Duplicity hasn’t gotten much love in past years but it’s gotten a refresh and its latest release at the time of writing is May 6, 2015, just a few weeks ago.

So, here’s a quick primer of the most useful commands I use with duplicity. You can find the whole manual with the man command:

If you’re wondering what my backup script looks like, the 15 line script (which includes a database dump and rsync to remote backup), looks something like this:

I hope you find some value in duplicity and I hope it helps you get a little sanity back in your backups by providing a simple frontend with a powerful backend.

Leave a Reply