From f1e4b99ceb0d87a1f43f03a77a1af2d76fe0ad80 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 18 Apr 2017 12:16:31 +0200 Subject: [PATCH] Respect "dry run mode" when continuing snapshots And don't rename the snapshot to the new name, no write access! --- bin/backup-script | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/backup-script b/bin/backup-script index f2df4db..4ae96d1 100755 --- a/bin/backup-script +++ b/bin/backup-script @@ -546,9 +546,13 @@ for f in "${sys[@]}"; do if [[ -n "$last" && ! -e "$last/.stamp" ]]; then # Old backup directory without "stamp file", continue echo "Found incomplete snapshot in \"$last\", reusing and renaming it ..." - if ! RenameSubvolume "$last" "$sys_target"; then - echo "Failed to rename last snapshot \"$last\" to \"$sys_target\"!? \"$system\" skipped!" - echo; continue + if [ "$DRYRUN" -eq 0 ]; then + if ! RenameSubvolume "$last" "$sys_target"; then + echo "Failed to rename last snapshot \"$last\" to \"$sys_target\"!? \"$system\" skipped!" + echo; continue + fi + else + echo " *** Trial run, not renaming snapshot \"$last\" to \"$sys_target\"!" fi elif [ -n "$last" ]; then # Old backup directory found, create new snapshot -- 2.39.2