duplicity gpg options

This commit is contained in:
Bob Mottram 2017-08-24 17:03:38 +01:00
parent 09d6beddb2
commit 1e0ca1c3e2
1 changed files with 7 additions and 6 deletions

View File

@ -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}/*