Check if UUID occurs twice for a configuration

Skip that configuration if that is the case.

Fixes #41.
This commit is contained in:
James Barnett
2017-06-01 08:46:43 -04:00
parent dffb4f4446
commit bfbcefbe31

View File

@@ -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