From 3033822423a3ba9ccf89b2e97d85db5675f06ad8 Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Sun, 12 Nov 2017 16:48:54 +0100 Subject: [PATCH] snap-sync: reflact subvolid for processed snapshot backup - snapper_sync_id should take into account the selected_subvolid in combination with the selected_uuid Signed-off-by: Ralf Zerres --- bin/snap-sync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/snap-sync b/bin/snap-sync index 706b226..2149345 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -271,7 +271,7 @@ run_config () { # Pseudo Arrays $i -> store associated elements of selected_config i=0 for selected_config in $selected_configs; do - count=$(eval snapper -c $selected_config list -t single | awk '/uuid='"$selected_uuid"'/, /subvolid'="$selected_subvol"'/ {cnt++} END {print cnt}') + count=$(eval snapper -c $selected_config list -t single | awk '/subvolid='"$selected_subvol"'/, /uuid='"$selected_uuid"'/ {cnt++} END {print cnt}') #count=$(eval snapper -c $selected_config list -t single | grep -c -e "subvolid=$selected_subvol" -e 'uuid=$selected_uuid') if [ -n "$count" ] && [ "$count" -gt 1 ]; then error "More than one snapper entry found with UUID $selected_uuid and SUBVOL $selected_subvol for configuration '$selected_config'. Skipping configuration '$selected_config'." @@ -337,7 +337,7 @@ run_config () { # processed snapshot backup is marked with userdata key/value pairs # backupdir, uuid - snapper_sync_id=$(eval snapper -c "$selected_config" list -t single | awk '/uuid='"$selected_uuid"'/ {print $1}') + snapper_sync_id=$(eval snapper -c "$selected_config" list -t single | awk '/subvolid='"$selected_subvol"'/, /uuid='"$selected_uuid"'/ {print $1}') if [ ${#snapper_sync_id} -gt 0 ]; then snapper_sync_snapshot=$SUBVOLUME/.snapshots/$snapper_sync_id/snapshot fi