Created
September 23, 2009 19:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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