Skip to content

Instantly share code, notes, and snippets.

@manur
Forked from olly/backup.sh
Created January 23, 2012 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manur/1661059 to your computer and use it in GitHub Desktop.
Save manur/1661059 to your computer and use it in GitHub Desktop.
Duplicity Backup Script
#!/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, by default the home directory
SOURCE=$HOME
# 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://some-bucket-name-on-s3/some-path-to-your-backup
duplicity \
incremental \
--encrypt-key ${GPG_KEY} \
--sign-key ${GPG_KEY} \
--include=$HOME \
--exclude=$HOME/Films \
--exclude=$HOME/Downloads \
--exclude="$HOME/VirtualBox VMs" \
--exclude=/** \
--volsize 250 \
${SOURCE} ${DEST}
# Reset the ENV variables. Don't need them sitting around
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export PASSPHRASE=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment