Skip to content

Instantly share code, notes, and snippets.

@mpasternacki
Created September 23, 2009 19:19
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 mpasternacki/192210 to your computer and use it in GitHub Desktop.
Save mpasternacki/192210 to your computer and use it in GitHub Desktop.
Script for easy Duplicity backup, suitable for both /etc/cron.daily/ and running by hand.
#!/bin/sh
set -e
local=/
remote=s3+http://***/
# figure out correct positional arg order for duplicity
case $1 in
''|full|incremental) positional="$local $remote" ;;
restore|verify) positional="$remote $local" ;;
*) positional="$remote" ;;
esac
export AWS_ACCESS_KEY_ID=***
export AWS_SECRET_ACCESS_KEY=***
export PASSPHRASE=***
# EXCLUSIONS:
# /dev, /proc, /sys, /tmp, /selinux, /lib/init/rw are meaningless in backups.
# /home/*/tmp is meant to be users' private (not backed up) space
set -x
exec time nice duplicity "${@}" \
--encrypt-key *** --sign-key *** \
--full-if-older-than 2W \
--exclude /dev --exclude /proc --exclude /sys --exclude /tmp \
--exclude /selinux --exclude /lib/init/rw \
--exclude /home/\*/tmp \
$positional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment