File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,12 @@ for x in $selected_configs; do
421421 new_info=" ${NEW_INFO_ARRAY[$i]} "
422422 backup_location=" ${BACKUPLOC_ARRAY[$i]} "
423423
424+ if ($ssh test -d " $backup_location /snapshot" ) ; then
425+ printf " ERROR: Backup directory '%s' already exists. Skipping backup of this configuration!\n" " $backup_location /snapshot" | tee $PIPE
426+ printf " Move or delete destination directory and try backup again.\n" | tee $PIPE
427+ continue
428+ fi
429+
424430 $ssh mkdir -p $backup_location
425431
426432 if [[ -z " $old_num " ]]; then
@@ -434,6 +440,7 @@ for x in $selected_configs; do
434440 # backup location. Using the -c flag instead of -p tells it that there
435441 # is an identical subvolume to the old snapshot at the receiving
436442 # location where it can get its data. This helps speed up the transfer.
443+
437444 btrfs send -c " $old_snap " " $new_snap " | $ssh btrfs receive " $backup_location "
438445 printf " Modifying data for old snapshot for %s...\n" " $x " | tee $PIPE
439446 snapper -v -c " $x " modify -d " old snap-sync snapshot (you may remove)" -u " backupdir=,subvolid=,uuid=" -c " number" " $old_num "
You can’t perform that action at this time.
0 commit comments