Skip to content

Instantly share code, notes, and snippets.

@ruflin
Created March 11, 2012 11:57
Show Gist options
  • Save ruflin/2016178 to your computer and use it in GitHub Desktop.
Save ruflin/2016178 to your computer and use it in GitHub Desktop.
Backup mit Duplicity auf S3
#!/bin/bash
# Set ENV variables
export AWS_ACCESS_KEY_ID=YOUR_AWS_ID
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_KEY
export PASSPHRASE="yourpassphrase"
# DEST and PARMS setup
DEST=s3+http://your.bucket.com/possible-sub-folder
PARAMS="--s3-european-buckets --s3-use-new-style --full-if-older-than 2W"
# Start backups
SOURCE=/var/www
duplicity ${PARAMS} ${SOURCE} ${DEST}${SOURCE}
duplicity remove-older-than 1M ${DEST}${SOURCE}
SOURCE=/other/path
duplicity ${PARAMS} ${SOURCE} ${DEST}${SOURCE}
duplicity remove-older-than 1M ${DEST}${SOURCE}
# Reset the ENV variables
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