|
@@ -35,7 +35,7 @@ SUSPENDED_SITE=
|
35
|
35
|
BACKUP_DUMMY_PASSWORD='backup'
|
36
|
36
|
|
37
|
37
|
BACKUP_TEMP_DIRECTORY=/root/.backuptemp
|
38
|
|
-BACKUPS_GPG_OPTIONS="--no-show-photos --pinentry-mode loopback"
|
|
38
|
+BACKUP_GPG_OPTIONS="--pinentry-mode loopback"
|
39
|
39
|
|
40
|
40
|
function create_backups_temp_directory {
|
41
|
41
|
if [ ! -d $BACKUP_TEMP_DIRECTORY ]; then
|
|
@@ -264,7 +264,7 @@ function set_obnam_client_name {
|
264
|
264
|
|
265
|
265
|
function backup_directory_to_usb_duplicity {
|
266
|
266
|
create_backups_temp_directory
|
267
|
|
- 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}
|
|
267
|
+ echo "$BACKUP_DUMMY_PASSWORD" | duplicity full --gpg-options "$BACKUP_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}
|
268
|
268
|
if [ ! "$?" = "0" ]; then
|
269
|
269
|
umount $USB_MOUNT
|
270
|
270
|
rm -rf $USB_MOUNT
|
|
@@ -278,7 +278,7 @@ function backup_directory_to_usb_duplicity {
|
278
|
278
|
exit 8352925
|
279
|
279
|
fi
|
280
|
280
|
if [[ $ENABLE_BACKUP_VERIFICATION == "yes" ]]; then
|
281
|
|
- 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}
|
|
281
|
+ echo "$BACKUP_DUMMY_PASSWORD" | duplicity verify --gpg-options "$BACKUP_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}
|
282
|
282
|
if [ ! "$?" = "0" ]; then
|
283
|
283
|
umount $USB_MOUNT
|
284
|
284
|
rm -rf $USB_MOUNT
|
|
@@ -361,7 +361,7 @@ function restore_directory_from_usb_obnam {
|
361
|
361
|
|
362
|
362
|
function restore_directory_from_usb_duplicity {
|
363
|
363
|
create_backups_temp_directory
|
364
|
|
- echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$USB_MOUNT/backup/${2} ${1}
|
|
364
|
+ echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUP_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$USB_MOUNT/backup/${2} ${1}
|
365
|
365
|
remove_backups_temp_directory
|
366
|
366
|
}
|
367
|
367
|
|
|
@@ -390,7 +390,7 @@ function restore_directory_from_friend_obnam {
|
390
|
390
|
|
391
|
391
|
function restore_directory_from_friend_duplicity {
|
392
|
392
|
create_backups_temp_directory
|
393
|
|
- echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUPS_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$SERVER_DIRECTORY/backup/${2} ${1}
|
|
393
|
+ echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUP_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$SERVER_DIRECTORY/backup/${2} ${1}
|
394
|
394
|
remove_backups_temp_directory
|
395
|
395
|
}
|
396
|
396
|
|
|
@@ -436,7 +436,7 @@ function set_user_permissions {
|
436
|
436
|
|
437
|
437
|
function backup_directory_to_friend_duplicity {
|
438
|
438
|
create_backups_temp_directory
|
439
|
|
- 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}
|
|
439
|
+ echo "$BACKUP_DUMMY_PASSWORD" | duplicity full --gpg-options "$BACKUP_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}
|
440
|
440
|
if [ ! "$?" = "0" ]; then
|
441
|
441
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
442
|
442
|
shred -zu ${1}/*
|
|
@@ -448,7 +448,7 @@ function backup_directory_to_friend_duplicity {
|
448
|
448
|
exit 5293526
|
449
|
449
|
fi
|
450
|
450
|
if [[ $ENABLE_BACKUP_VERIFICATION == "yes" ]]; then
|
451
|
|
- 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}
|
|
451
|
+ echo "$BACKUP_DUMMY_PASSWORD" | duplicity verify --gpg-options "$BACKUP_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}
|
452
|
452
|
if [ ! "$?" = "0" ]; then
|
453
|
453
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
454
|
454
|
shred -zu ${1}/*
|