From 3f0e8d9c453395c1b49a3dfe126cedb257d51e7b Mon Sep 17 00:00:00 2001 From: Harvie Date: Wed, 15 Jun 2011 18:14:36 +0200 Subject: [PATCH] Added DuP - duplicity wrapper for easy backups --- bash/dup.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 bash/dup.sh diff --git a/bash/dup.sh b/bash/dup.sh new file mode 100755 index 0000000..664b0c0 --- /dev/null +++ b/bash/dup.sh @@ -0,0 +1,48 @@ +CONF=.dup.conf +[ -f "$CONF" ] && eval "$(cat "$CONF")" || { echo no "$CONF"; exit 23; } +export PASSPHRASE="$DUPLICITY_PASSPHRASE"; + +DUPLICITY_SOURCE="./" +DUPLICITY=duplicity +#BACKUP_TARGET="file:///tmp/bkp" + +case "$1" in + backup) + "$DUPLICITY" $DFLAGS "$DUPLICITY_SOURCE" "$DUPLICITY_TARGET";; + full) + "$DUPLICITY" full $DUPLICITY_FLAGS "$DUPLICITY_SOURCE" "$DUPLICITY_TARGET";; + verify) + "$DUPLICITY" verify $DUPLICITY_FLAGS "$DUPLICITY_TARGET" "$DUPLICITY_SOURCE";; + list) + "$DUPLICITY" list-current-files "$DUPLICITY_TARGET";; + status) + "$DUPLICITY" collection-status "$DUPLICITY_TARGET";; + cleanup) + "$DUPLICITY" cleanup --force "$DUPLICITY_TARGET";; + restore) + echo you can restore your files using this command: + echo "PASSPHRASE='$PASSPHRASE' '$DUPLICITY' restore '$DUPLICITY_TARGET' /tmp/restored";; + man) + man duplicity;; + *|help) + echo " + ################################################################### + # + # $0 for backing-up using duplicity + # --> http://duplicity.nongnu.org/ + # + # $0 - same as '$0 help' + # $0 backup - backup (full or incremental) + # $0 full - full backup + # $0 verify - compare local files with backup + # $0 list - list files on backup + # $0 status - print backup status + # $0 cleanup - remove extraneous files from backup + # $0 restore - print command to restore files + # $0 help - print this help + # $0 man - show duplicity manpage + # +";; +esac + +export PASSPHRASE='' -- 2.30.2