From 3cfaebe58146c66d9a581175e13ab367c71fbd31 Mon Sep 17 00:00:00 2001 From: Enoch Root Date: Sun, 29 Apr 2018 23:01:18 +0200 Subject: [PATCH] Initial commit of script --- backup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 backup.sh diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..eb20770 --- /dev/null +++ b/backup.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# uncomment for debug +#set -x + +source .duplicity.conf +source venv2/bin/activate + +# duplicity command +DUPEXEC="duplicity --encrypt-key $ENCRKEY --sign-key $SIGNKEY $DUPOPTS $*" +# loop on directories +echo -n "---- Incremental backup of $HOSTNAME ---- "; date + +for i in $BACKDIRS +do + echo Starting backup of directory $i + # create directory, then backup, then erase old backups + $DUPEXEC $i b2://$B2_ACCOUNT_ID:$B2_APPLICATION_KEY@$BUCKET && $DUPEXEC $DUPOPTS_CLEANUP b2://$B2_ACCOUNT_ID:$B2_APPLICATION_KEY@$BUCKET + # verify backup integrity + #$DUPEXEC --verify b2://$B2_ACCOUNT_ID:$B2_APPLICATION_KEY@$BUCKET $i +done + +echo -n "---- Finished backup on $HOSTNAME ---- "; date + -- 2.47.3