Category Archives: DevOps

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