Skip to content

Commit

Permalink
For issue #8, check if the youngest remote snapshot is from zap
Browse files Browse the repository at this point in the history
  • Loading branch information
Jehops committed Oct 2, 2017
1 parent 24a0ee5 commit 773aff0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zap
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ a resilver in progress."
# get the youngest remote snapshot for this dataset
# interpret remote command with sh to avoid surprises with remote shell
rsnap=$(ssh "$sshto" "sh -c 'zfs list -rd1 -H -tsnap -o name -S \
creation $rloc/$fs 2>/dev/null | grep -m1 @ZAP_${hn}_'" | sed 's/^.*@/@/')
creation $rloc/$fs 2>/dev/null | head -n1'" | sed 's/^.*@/@/')
if [ -z "$rsnap" ]; then
[ -n "$v_opt" ] && \
echo "No remote snapshots found. Sending full stream."
Expand Down Expand Up @@ -345,6 +345,9 @@ $rloc'\""
else
warn "Failed to replicate $lsnap to $sshto:$rloc"
fi
elif [ "${rsnap#*@ZAP_${hn}_}" = "${rsnap}" ]; then
echo "Failed to replicate $1, because the youngest snapshot for \
$sshto:$rloc/$fs was not created by zap."
else # send incremental stream
r_ts=$(ss_ts "$(ss_st "$rsnap")")
# if [ -n "$v_opt" ]; then
Expand Down

0 comments on commit 773aff0

Please sign in to comment.