Created
July 19, 2010 10:35
-
-
Save chihchun/481254 to your computer and use it in GitHub Desktop.
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 | |
# Rex Tsai <[email protected]> | |
BKDIR=/media/backup/backup | |
KEY=DC76FEB9 | |
# OP=incremental | |
# OP=full | |
# OP=collection-status | |
# OP=cleanup | |
# OP="remove-older-than time" | |
# OP=list-current-files | |
# OP=verify | |
OP=$1 | |
TARGET=$2 | |
set -e | |
function askpass () | |
{ | |
if [ -z $PASSPHRASE ] ; then | |
echo -n "GnuPG passphrase: " | |
read -s PASSPHRASE | |
export PASSPHRASE | |
fi | |
} | |
if [ ! -d $BKDIR ] ; then | |
echo "$BKDIR does not exist" | |
exit -1 | |
fi | |
askpass | |
if [ x"$TARGET" == x ] || [ $TARGET == 'workspace' ] ; then | |
nice -n 19 \ | |
duplicity ${OP} --encrypt-key ${KEY} \ | |
--include "${HOME}/workspace/Projects" \ | |
--include "${HOME}/workspace/routers" \ | |
--include "${HOME}/workspace/qrc0cde" \ | |
--include "${HOME}/workspace/gae" \ | |
--include "${HOME}/workspace/ubiquity" \ | |
--include "${HOME}/workspace/cakephp" \ | |
--include "${HOME}/workspace/greasemonkey" \ | |
--include "${HOME}/workspace/certalert" \ | |
--exclude '**'\ | |
--allow-source-mismatch \ | |
--verbosity info \ | |
${HOME}/workspace \ | |
file://${BKDIR}/workspace | |
fi | |
# stuff | |
if [ x"$TARGET" == x ] || [ $TARGET == 'stuff' ] ; then | |
nice -n 19 \ | |
duplicity ${OP} --encrypt-key ${KEY} \ | |
--include "${HOME}/stuff" \ | |
--include "${HOME}/Desktop" \ | |
--include "${HOME}/.liferea_1.6/feedlist.opml" \ | |
--include "${HOME}/.tomboy" \ | |
--include "${HOME}/.config/gpodder/channels.opml" \ | |
--include "${HOME}/.openoffice.org" \ | |
--include "${HOME}/.xchat2" \ | |
--include "${HOME}/.Skype" \ | |
--include "${HOME}/.gnome" \ | |
--include "${HOME}/.gnome2" \ | |
--include "${HOME}/.local" \ | |
--exclude '**'\ | |
--allow-source-mismatch \ | |
--verbosity info \ | |
/ \ | |
file://${BKDIR}/stuff | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment