Add zfs-recv option to keep partial after interupt.

This commit is contained in:
Otho 2022-11-24 00:30:16 -05:00
parent 07d48d3031
commit 0990f17d87
Signed by: Otho
GPG Key ID: 16C720CD3BBE21D9

View File

@ -92,12 +92,12 @@ send_single_snapshot()
echo zfs send -R ${BG_ROOT}@${BG_NEW_SNAPSHOT} echo zfs send -R ${BG_ROOT}@${BG_NEW_SNAPSHOT}
echo ssh -i ~/.ssh/id_rsa -o port=${BG_REMOTE_PORT} \ echo ssh -i ~/.ssh/id_rsa -o port=${BG_REMOTE_PORT} \
${BG_REMOTE_USER}@${BG_REMOTE_ADDR} \ ${BG_REMOTE_USER}@${BG_REMOTE_ADDR} \
zfs receive -dvu ${BG_REMOTE_ROOT} zfs receive -sdvu ${BG_REMOTE_ROOT}
else else
zfs send -R ${BG_ROOT}@${BG_NEW_SNAPSHOT} | zfs send -R ${BG_ROOT}@${BG_NEW_SNAPSHOT} |
ssh -i ~/.ssh/id_rsa -o port=${BG_REMOTE_PORT} \ ssh -i ~/.ssh/id_rsa -o port=${BG_REMOTE_PORT} \
${BG_REMOTE_USER}@${BG_REMOTE_ADDR} \ ${BG_REMOTE_USER}@${BG_REMOTE_ADDR} \
zfs receive -dvu ${BG_REMOTE_ROOT} zfs receive -sdvu ${BG_REMOTE_ROOT}
fi fi
done < sendnodes.tmp done < sendnodes.tmp
rm sendnodes.tmp rm sendnodes.tmp
@ -116,7 +116,7 @@ send_incremental_snapshot()
# zfs send -R -i `cat old-snapshot.txt` ${BG_ROOT}@${BG_NEW_SNAPSHOT} | # zfs send -R -i `cat old-snapshot.txt` ${BG_ROOT}@${BG_NEW_SNAPSHOT} |
# ssh -i ~/.ssh/id_rsa -o port=${BG_REMOTE_PORT} \ # ssh -i ~/.ssh/id_rsa -o port=${BG_REMOTE_PORT} \
# ${BG_REMOTE_USER}@${BG_REMOTE_ADDR} \ # ${BG_REMOTE_USER}@${BG_REMOTE_ADDR} \
# zfs receive -dvu ${BG_REMOTE_ROOT}@${BG_NEW_SNAPSHOT} # zfs receive -sdvu ${BG_REMOTE_ROOT}@${BG_NEW_SNAPSHOT}
#done #done
echo $BG_NEW_SNAPSHOT > "old-snapshot.txt" echo $BG_NEW_SNAPSHOT > "old-snapshot.txt"
} }