|
|
|
|
35
|
BACKUP_DUMMY_PASSWORD='backup'
|
35
|
BACKUP_DUMMY_PASSWORD='backup'
|
36
|
|
36
|
|
37
|
BACKUP_TEMP_DIRECTORY=/root/.backuptemp
|
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
|
function create_backups_temp_directory {
|
40
|
function create_backups_temp_directory {
|
41
|
if [ ! -d $BACKUP_TEMP_DIRECTORY ]; then
|
41
|
if [ ! -d $BACKUP_TEMP_DIRECTORY ]; then
|
|
|
|
|
264
|
|
264
|
|
265
|
function backup_directory_to_usb_duplicity {
|
265
|
function backup_directory_to_usb_duplicity {
|
266
|
create_backups_temp_directory
|
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
|
if [ ! "$?" = "0" ]; then
|
268
|
if [ ! "$?" = "0" ]; then
|
269
|
umount $USB_MOUNT
|
269
|
umount $USB_MOUNT
|
270
|
rm -rf $USB_MOUNT
|
270
|
rm -rf $USB_MOUNT
|
|
|
|
|
278
|
exit 8352925
|
278
|
exit 8352925
|
279
|
fi
|
279
|
fi
|
280
|
if [[ $ENABLE_BACKUP_VERIFICATION == "yes" ]]; then
|
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
|
if [ ! "$?" = "0" ]; then
|
282
|
if [ ! "$?" = "0" ]; then
|
283
|
umount $USB_MOUNT
|
283
|
umount $USB_MOUNT
|
284
|
rm -rf $USB_MOUNT
|
284
|
rm -rf $USB_MOUNT
|
|
|
|
|
361
|
|
361
|
|
362
|
function restore_directory_from_usb_duplicity {
|
362
|
function restore_directory_from_usb_duplicity {
|
363
|
create_backups_temp_directory
|
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
|
remove_backups_temp_directory
|
365
|
remove_backups_temp_directory
|
366
|
}
|
366
|
}
|
367
|
|
367
|
|
|
|
|
|
390
|
|
390
|
|
391
|
function restore_directory_from_friend_duplicity {
|
391
|
function restore_directory_from_friend_duplicity {
|
392
|
create_backups_temp_directory
|
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
|
remove_backups_temp_directory
|
394
|
remove_backups_temp_directory
|
395
|
}
|
395
|
}
|
396
|
|
396
|
|
|
|
|
|
436
|
|
436
|
|
437
|
function backup_directory_to_friend_duplicity {
|
437
|
function backup_directory_to_friend_duplicity {
|
438
|
create_backups_temp_directory
|
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
|
if [ ! "$?" = "0" ]; then
|
440
|
if [ ! "$?" = "0" ]; then
|
441
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
441
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
442
|
shred -zu ${1}/*
|
442
|
shred -zu ${1}/*
|
|
|
|
|
448
|
exit 5293526
|
448
|
exit 5293526
|
449
|
fi
|
449
|
fi
|
450
|
if [[ $ENABLE_BACKUP_VERIFICATION == "yes" ]]; then
|
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
|
if [ ! "$?" = "0" ]; then
|
452
|
if [ ! "$?" = "0" ]; then
|
453
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
453
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
|
454
|
shred -zu ${1}/*
|
454
|
shred -zu ${1}/*
|