Backups with Amazon S3 and Duplicity

I had to set up proper full backups for a client website, S3 seemed like an economical way to go (time will tell). Duplicity is a script which uses rsync to back up incrementally, which will save data transfer. It can also encrypt the data and a bunch of other goodies.

Installing Duplicity

Since the site was running on Centos (Debian forever!) and the Yum repositories don’t have Duplicity, I had to add some the rpmforge repository:

Now duplicity will install:

It also requires Google’s boto library

Make the backup script

Now make a shell script something like this:

PASSPHRASE can be anything you want, just make it long so the encryption is strong.

The keys come from AWS – see https://portal.aws.amazon.com/gp/aws/securityCredentials

“–full-if-older-than 30D” will make duplicity perform a full backup every 30 days. Otherwise it does incremental backups.

You can also make a restore script by swapping the duplicity arguments

Add the script to cron

References

2 thoughts on “Backups with Amazon S3 and Duplicity

  1. Pingback: Easy As Pi Tor Proxy | LAS s27e05 | Jupiter Broadcasting

  2. Pelle Nilsson

    I’m setting up a backup solution like this one with DreamHost/DreamObjects which also use the S3 protocol. This guide saved my day since I didn’t find the needed AWS_* variables in the duplicity documentation, thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *