From cf353fafd4d2dc5bb3efa7141aeee0d733aebb19 Mon Sep 17 00:00:00 2001 From: Kevin McCormick Date: Fri, 16 Sep 2016 15:50:26 -0700 Subject: [PATCH] Allow matching any snapshot between src & dest Previously we looked for the specific tagged snapshot, but that doesn't actually work properly. Now simply find the most recent snapshot on dest and compare to src. It must exist on src. --- backup-zfs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backup-zfs b/backup-zfs index 1d8915d..90d67f7 100755 --- a/backup-zfs +++ b/backup-zfs @@ -121,10 +121,9 @@ cur="$srcfs@${tag}_$date" ZFS "$srchost" snapshot -r "$cur" || die $? "zfs snapshot failed" ### -### find newest snapshot matching the tag on dest +### get newest snapshot on dest - it must exist on src ### -last="$(ZFS "$desthost" list -d 1 -t snapshot -H -S creation -o name $destfs/$srcbase 2>/dev/null \ - | grep -F "@${tag}_" | head -n1 | cut -f2 -d@)" +last="$(ZFS "$desthost" list -d 1 -t snapshot -H -S creation -o name $destfs/$srcbase | head -n1 | cut -f2 -d@)" ### ### send & receive