From 07b92a891920633eb9a95b2a1e43dc04d109ddf2 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sat, 26 Jun 2021 20:06:44 +0200 Subject: [PATCH] wip --- bundles/backup/files/backup_path_via_zfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/backup/files/backup_path_via_zfs b/bundles/backup/files/backup_path_via_zfs index db05d74..3916a59 100644 --- a/bundles/backup/files/backup_path_via_zfs +++ b/bundles/backup/files/backup_path_via_zfs @@ -29,13 +29,13 @@ fi zfs snap "$source_dataset@$new_bookmark" -if zfs list -t bookmark -H -o name | grep "#$bookmark_prefix" | wc -l | grep -q "^0$" +if zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | wc -l | grep -q "^0$" then echo "INITIAL BACKUP" zfs send -v "$source_dataset@$new_bookmark" | $ssh sudo zfs recv -F "$target_dataset" else echo "INCREMENTAL BACKUP" - last_bookmark=$(zfs list -t bookmark -H -o name | grep "#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2) + last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2) [[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98 zfs send -v -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset" fi