From bfbcefbe31cbe7695edeb71badec72e3080b652d Mon Sep 17 00:00:00 2001 From: James Barnett Date: Thu, 1 Jun 2017 08:46:43 -0400 Subject: [PATCH] Check if UUID occurs twice for a configuration Skip that configuration if that is the case. Fixes #41. --- bin/snap-sync | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/snap-sync b/bin/snap-sync index ca4a36b..f774bd0 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -230,6 +230,11 @@ printf "\nInitial configuration...\n" | tee $PIPE i=0 for x in $selected_configs; do + if [[ "$(snapper -c $x list -t single | awk '/'"$selected_uuid"'/ {cnt++} END {print cnt}')" -gt 1 ]]; then + error "More than one snapper entry found with UUID $selected_uuid for configuration $x. Skipping configuration $x." + continue + fi + if [[ "$(snapper -c $x list -t single | awk '/'$name' backup in progress/ {cnt++} END {print cnt}')" -gt 0 ]]; then printf "\nNOTE: Previous failed %s backup snapshots found for '%s'.\n" "$name" "$x" | tee $PIPE read -r -p "Delete failed backup snapshots [y/N]? " delete_failed