Skip to content

Selah.

Pause, and calmly think on that.

Menu
  • About
  • Chords
  • Free Gift
  • Highlights
  • Links
  • Microposts
  • The New Covenant
  • The Small Web
Menu

Duplicity – Pleasure and Simplicity in Your Backups

Posted on May 19, 2015February 8, 2017 by Shovas

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:

# First and subsequent backups without encryption
# - First is a full backup, subsequent are incremental
duplicity /etc file:///backup/duplicity/etc --no-encryption

# Explicit Full backup
duplicity full /etc file:///backup/duplicity/etc --no-encryption

# Explicit incremental backup (will abort if no old signatures found)
duplicity incr /etc file:///backup/duplicity/etc --no-encryption

# Check status of backup (set count, volume count, full backup count,
# incremental backup count, orphaned or incomplete backup sets, etc.)
duplicity collection-status file:///backup/duplicity/etc/ --no-encryption

# List current files in backup
duplicity list-current-files file:///backup/duplicity/etc/ --no-encryption

# Extract backup to a given directory
duplicity restore file:///backup/duplicity/etc /tmp/etc.old --no-encryption

# Extract specific file/directory from backup
duplicity restore --file-to-restore passwd file:///backup/duplicity/etc/ /tmp/ --no-encryption

# Extract specific point-in-time file/directory from backup
# - See TIME FORMATS in `man duplicity`
#   ^ ISO 8601 Date-Time Format
duplicity restore --file-to-restore passwd --time '2017/01/24' file:///backup/duplicity/etc/ /tmp/ --no-encryption

# Verify backup against source (show diffs in backup versus source)
duplicity verify file://duplicity/etc /etc --no-encryption

# Remove backup sets older-than / Clean up / Consolidate backups
# - See `man duplicity` TIME FORMATS
# - 7D = 7 Days
duplicity remove-older-than 7D file:///backup/duplicity/etc/ --no-encryption

# Disable encryption add argument:
--no-encryption

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:

#!/bin/sh

# Backup
duplicity /etc file:///backup/duplicity/etc --no-encryption --full-if-older-than 3M
duplicity /root file:///backup/duplicity/root --no-encryption --full-if-older-than 3M
duplicity /home/matt file:///backup/duplicity/matt --no-encryption --full-if-older-than 3M

# Clean up
duplicity remove-all-but-n-full 1 --force file:///backup/duplicity/root --no-encryption
duplicity remove-all-but-n-full 1 --force file:///backup/duplicity/etc --no-encryption
duplicity remove-all-but-n-full 1 --force file:///backup/duplicity/matt --no-encryption

# Backup database
...backup database...

# Sync off-site
...rsync to rsync.net - great service by the way...

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.

Comment Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.

Loading ...

No more microposts.

  • Re: Engine stall fix: Citroën 2.0 HDI 150
  • Answering Anti-Flood Objections: The Genesis Flood For Kids (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Bee Beginnings Baffle Biology Boffins (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Solving the mystery of the DEVIL’S CORKSCREW (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Witnessing the time of DRAGONS – What dinosaur behaviours did humans experience before the flood? (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Fire & Ice: The surprising story of the Bandera Volcano Ice Cave (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Humans before plants? Why Genesis does not contradict itself. (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Ancient Artwork Shows Jerusalem Left Unscathed (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Reading: Not a happy accident (Creation Magazine Summer 2026 Vol. 48 No. 3)
  • Creation Focus News And Views (Creation Magazine 2026 Vol. 48 No. 3)

bible canada centos christ christian christmas church creation Creation Magazine evolution faith family game genesis God gog good google government heart iracing jesus life linux love matthew music pc poem poetry quote racing romantical salvation science sim sin Small Web Smallweb Finds truth update video windows word YouTube

Log in
© 2026 Selah. | Powered by Superbs Personal Blog theme