|
@@ -127,6 +127,9 @@ function backup_configuration {
|
127
|
127
|
fi
|
128
|
128
|
cp -f $CONFIG_FILE /root/tempbackupconfig
|
129
|
129
|
cp -f $COMPLETION_FILE /root/tempbackupconfig
|
|
130
|
+ if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
|
131
|
+ cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
|
|
132
|
+ fi
|
130
|
133
|
backup_directory_to_friend /root/tempbackupconfig config
|
131
|
134
|
}
|
132
|
135
|
|
|
@@ -439,6 +442,38 @@ function disperse_key_shares {
|
439
|
442
|
fi
|
440
|
443
|
}
|
441
|
444
|
|
|
445
|
+function valid_backup_destination {
|
|
446
|
+ destination_dir="$1"
|
|
447
|
+ is_valid="yes"
|
|
448
|
+
|
|
449
|
+ if [[ "$destination_dir" == "hubzilla" || \
|
|
450
|
+ "$destination_dir" == "hubzilladata" || \
|
|
451
|
+ "$destination_dir" == "gogs" || \
|
|
452
|
+ "$destination_dir" == "gogsrepos" || \
|
|
453
|
+ "$destination_dir" == "gogsssh" || \
|
|
454
|
+ "$destination_dir" == "gnusocial" || \
|
|
455
|
+ "$destination_dir" == "gnusocialdata" || \
|
|
456
|
+ "$destination_dir" == "mariadb" || \
|
|
457
|
+ "$destination_dir" == "config" || \
|
|
458
|
+ "$destination_dir" == "letsencrypt" || \
|
|
459
|
+ "$destination_dir" == "wiki" || \
|
|
460
|
+ "$destination_dir" == "wiki2" || \
|
|
461
|
+ "$destination_dir" == "xmpp" || \
|
|
462
|
+ "$destination_dir" == "ipfs" || \
|
|
463
|
+ "$destination_dir" == "dlna" || \
|
|
464
|
+ "$destination_dir" == "tox" || \
|
|
465
|
+ "$destination_dir" == "ssl" || \
|
|
466
|
+ "$destination_dir" == "blog" || \
|
|
467
|
+ "$destination_dir" == "owncloud" || \
|
|
468
|
+ "$destination_dir" == "owncloud2" || \
|
|
469
|
+ "$destination_dir" == "ownclouddata" || \
|
|
470
|
+ "$destination_dir" == "mailinglist" ]]; then
|
|
471
|
+ is_valid="no"
|
|
472
|
+ fi
|
|
473
|
+
|
|
474
|
+ echo $is_valid
|
|
475
|
+}
|
|
476
|
+
|
442
|
477
|
function backup_extra_directories {
|
443
|
478
|
if [ ! -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
444
|
479
|
return
|
|
@@ -450,7 +485,12 @@ function backup_extra_directories {
|
450
|
485
|
backup_dir=$(echo "$backup_line" | awk -F ',' '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
451
|
486
|
if [ -d "$backup_dir" ]; then
|
452
|
487
|
destination_dir=$(echo "$backup_line" | awk -F ',' '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
453
|
|
- backup_directory_to_friend "$backup_dir" "$destination_dir"
|
|
488
|
+ if [[ $(valid_backup_destination "$destination_dir") == "yes" ]]; then
|
|
489
|
+ backup_directory_to_friend "$backup_dir" "$destination_dir"
|
|
490
|
+ else
|
|
491
|
+ echo $"WARNING: The backup directory $destination_dir is already used."
|
|
492
|
+ echo $"Choose a different destination name for backing up $backup_dir"
|
|
493
|
+ fi
|
454
|
494
|
else
|
455
|
495
|
echo $"WARNING: Directory $backup_dir does not exist"
|
456
|
496
|
fi
|