add incremental send
This commit is contained in:
parent
956f2e65f6
commit
acef33b4d5
@ -73,7 +73,15 @@ done
|
||||
|
||||
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 ]
|
||||
then
|
||||
zfs set backup:success="true" $SRCZFS
|
||||
|
Loading…
Reference in New Issue
Block a user