From 1e0ca1c3e258fec8c53d06e5aa7cd3e32bf08ec9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 24 Aug 2017 17:03:38 +0100 Subject: [PATCH] duplicity gpg options --- src/freedombone-utils-backup | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/freedombone-utils-backup b/src/freedombone-utils-backup index 7c53eef0..88fedfc6 100755 --- a/src/freedombone-utils-backup +++ b/src/freedombone-utils-backup @@ -35,6 +35,7 @@ SUSPENDED_SITE= BACKUP_DUMMY_PASSWORD='backup' BACKUP_TEMP_DIRECTORY=/root/.backuptemp +BACKUPS_GPG_OPTIONS="--no-show-photos --pinentry-mode loopback" function create_backups_temp_directory { if [ ! -d $BACKUP_TEMP_DIRECTORY ]; then @@ -263,7 +264,7 @@ function set_obnam_client_name { function backup_directory_to_usb_duplicity { create_backups_temp_directory - echo "$BACKUP_DUMMY_PASSWORD" | duplicity full --tempdir $BACKUP_TEMP_DIRECTORY --encrypt-key $MY_BACKUP_KEY_ID --full-if-older-than 4W --exclude-other-filesystems ${1} file://$USB_MOUNT/backup/${2} + echo "$BACKUP_DUMMY_PASSWORD" | duplicity full --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --encrypt-key $MY_BACKUP_KEY_ID --full-if-older-than 4W --exclude-other-filesystems ${1} file://$USB_MOUNT/backup/${2} if [ ! "$?" = "0" ]; then umount $USB_MOUNT rm -rf $USB_MOUNT @@ -277,7 +278,7 @@ function backup_directory_to_usb_duplicity { exit 8352925 fi if [[ $ENABLE_BACKUP_VERIFICATION == "yes" ]]; then - echo "$BACKUP_DUMMY_PASSWORD" | duplicity verify --tempdir $BACKUP_TEMP_DIRECTORY --encrypt-key $MY_BACKUP_KEY_ID --full-if-older-than 4W --exclude-other-filesystems ${1} file://$USB_MOUNT/backup/${2} + echo "$BACKUP_DUMMY_PASSWORD" | duplicity verify --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --encrypt-key $MY_BACKUP_KEY_ID --full-if-older-than 4W --exclude-other-filesystems ${1} file://$USB_MOUNT/backup/${2} if [ ! "$?" = "0" ]; then umount $USB_MOUNT rm -rf $USB_MOUNT @@ -360,7 +361,7 @@ function restore_directory_from_usb_obnam { function restore_directory_from_usb_duplicity { create_backups_temp_directory - echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --tempdir $BACKUP_TEMP_DIRECTORY --force file://$USB_MOUNT/backup/${2} ${1} + echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$USB_MOUNT/backup/${2} ${1} remove_backups_temp_directory } @@ -389,7 +390,7 @@ function restore_directory_from_friend_obnam { function restore_directory_from_friend_duplicity { create_backups_temp_directory - echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --tempdir $BACKUP_TEMP_DIRECTORY --force file://$SERVER_DIRECTORY/backup/${2} ${1} + echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$SERVER_DIRECTORY/backup/${2} ${1} remove_backups_temp_directory } @@ -435,7 +436,7 @@ function set_user_permissions { function backup_directory_to_friend_duplicity { create_backups_temp_directory - echo "$BACKUP_DUMMY_PASSWORD" | duplicity full --tempdir $BACKUP_TEMP_DIRECTORY --ssh-askpass --encrypt-key ${ADMIN_BACKUP_KEY_ID} --full-if-older-than 4W --exclude-other-filesystems ${1} $SERVER_DIRECTORY/backup/${2} + echo "$BACKUP_DUMMY_PASSWORD" | duplicity full --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --ssh-askpass --encrypt-key ${ADMIN_BACKUP_KEY_ID} --full-if-older-than 4W --exclude-other-filesystems ${1} $SERVER_DIRECTORY/backup/${2} if [ ! "$?" = "0" ]; then if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then shred -zu ${1}/* @@ -447,7 +448,7 @@ function backup_directory_to_friend_duplicity { exit 5293526 fi if [[ $ENABLE_BACKUP_VERIFICATION == "yes" ]]; then - echo "$BACKUP_DUMMY_PASSWORD" | duplicity verify --tempdir $BACKUP_TEMP_DIRECTORY --ssh-askpass --encrypt-key ${ADMIN_BACKUP_KEY_ID} --full-if-older-than 4W --exclude-other-filesystems ${1} $SERVER_DIRECTORY/backup/${2} + echo "$BACKUP_DUMMY_PASSWORD" | duplicity verify --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --ssh-askpass --encrypt-key ${ADMIN_BACKUP_KEY_ID} --full-if-older-than 4W --exclude-other-filesystems ${1} $SERVER_DIRECTORY/backup/${2} if [ ! "$?" = "0" ]; then if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then shred -zu ${1}/*