From: Enoch Root Date: Sun, 29 Apr 2018 21:01:18 +0000 (+0200) Subject: Initial commit of script X-Git-Url: http://git.rustad.me/?a=commitdiff_plain;h=3cfaebe58146c66d9a581175e13ab367c71fbd31;p=backup Initial commit of script --- 3cfaebe58146c66d9a581175e13ab367c71fbd31 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 +