Skip to content

Instantly share code, notes, and snippets.

@olly
Created October 9, 2008 20:59
Show Gist options
  • Save olly/15890 to your computer and use it in GitHub Desktop.
Save olly/15890 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Export some ENV variables so you don't have to type anything
export AWS_ACCESS_KEY_ID=<your-access-key-id>
export AWS_SECRET_ACCESS_KEY=<your-secret-access-key>
export PASSPHRASE=<your-gpg-passphrase>
GPG_KEY=<your-gpg-key>
# The source of your backup
SOURCE=/
# The destination
# Note that the bucket need not exist
# but does need to be unique amongst all
# Amazon S3 users. So, choose wisely.
DEST=s3+http://51degrees_backup
duplicity \
incremental \
--full-if-older-than 1M \
--encrypt-key ${GPG_KEY} \
--sign-key ${GPG_KEY} \
--include=/etc \
--include=/home \
--include=/root \
--include=/srv \
--exclude=/** \
--volsize 250 \
${SOURCE} ${DEST}
duplicity remove-older-than 6M --force ${DEST}
# Reset the ENV variables. Don't need them sitting around
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export PASSPHRASE=
@maxxer
Copy link

maxxer commented Dec 6, 2017

a little OT, but how can you estimate the costs of S3 storage with Duplicity? Other than the space itself, how much does the GET/PUT performed by the software weigh? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment