ssh mode: fix last snapshot tracking

This commit is contained in:
Kevin McCormick 2017-03-07 15:23:40 -08:00
parent 28c7cbc747
commit afb2b924ba

View File

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