add incremental send

This commit is contained in:
Jochen Welzel 2021-01-06 10:29:58 +01:00
parent 956f2e65f6
commit acef33b4d5

View File

@ -73,7 +73,15 @@ done
virsh snapshot-delete $VM $SNAPNAME --metadata virsh snapshot-delete $VM $SNAPNAME --metadata
zfs send "$SRCZFS"@"$SNAPNAME" | pv -L 500M | ssh $DESTHOST sudo zfs recv -F $DESTZFS SUCCESS=$(zfs get backup:success -H -o value $SRCZFS)
if [[ $SUCCESS == "true" ]]
then
LASTBACKUP=$(zfs get backup:date -H -o value $SRCZFS)
LASTSNAP="backup_$LASTBACKUP"
zfs send -i "$SRCZFS"@"$LASTSNAP" "$SRCZFS"@"$SNAPNAME" | pv -L 500M | ssh $DESTHOST sudo zfs recv -F $DESTZFS
else
zfs send "$SRCZFS"@"$SNAPNAME" | pv -L 500M | ssh $DESTHOST sudo zfs recv -F $DESTZFS
fi
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
zfs set backup:success="true" $SRCZFS zfs set backup:success="true" $SRCZFS