From afb2b924ba325cc38a98fb5df0869be23c9473c0 Mon Sep 17 00:00:00 2001 From: Kevin McCormick Date: Tue, 7 Mar 2017 15:23:40 -0800 Subject: [PATCH] ssh mode: fix last snapshot tracking --- backup-zfs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backup-zfs b/backup-zfs index c5bbc19..b37f1fc 100755 --- a/backup-zfs +++ b/backup-zfs @@ -140,7 +140,8 @@ if $tossh ; then ### ### create new snapshot on src ### - cur="$src@${tag}_$date" + snap="${tag}_$date" + cur="$src@$snap" ZFS "$srchost" snapshot -r "$cur" || die $? "zfs snapshot failed" ### @@ -167,10 +168,12 @@ if $tossh ; then | gpg --trust-model always --encrypt --recipient "$gpgid" \ | ssh "$desthost" "cat > \"$destpath/${tag}_$date.zfssnap.gpg\"" \ || die $? "zfs incremental send failed" + ssh "$desthost" "echo \"$snap\" > \"$destpath/.last\"" else ZFS "$srchost" send $send_opts -R -I "$last" "$cur" \ | ssh "$desthost" "cat > \"$destpath/${tag}_$date.zfssnap\"" \ || die $? "zfs incremental send failed" + ssh "$desthost" "echo \"$snap\" > \"$destpath/.last\"" fi fi