Fei
Explorer
- Joined
- Jan 13, 2014
- Messages
- 80
Hi
I want to use zfs send & recv to do incremental backup, and setting a auto-snapshot on receive side.
The script run full backup is normal , but when it run the incremental backup ,it always destroy my auto-snapshot. :(
I think this problem is time ssh root@$host zfs send -R -i $snapshot_latest $snapshot_current | zfs recv -Fv $destination , but I dont know how to modify it.
The sending side always keep 1 snapshot,because I don't want to use the sending side much space.
so when script done,it will destroy previous snapshot and keep current snapshot.
<my script>
<script log>
I want to use zfs send & recv to do incremental backup, and setting a auto-snapshot on receive side.
The script run full backup is normal , but when it run the incremental backup ,it always destroy my auto-snapshot. :(
I think this problem is time ssh root@$host zfs send -R -i $snapshot_latest $snapshot_current | zfs recv -Fv $destination , but I dont know how to modify it.
The sending side always keep 1 snapshot,because I don't want to use the sending side much space.
so when script done,it will destroy previous snapshot and keep current snapshot.
<my script>
Code:
snapshot_current="$pool@"`date "+%Y-%m-%d-%H-%M"` snapshot_latest="$pool@latest" if ssh root@$host zfs list -H -o name -t snapshot | sort | grep "$snapshot_latest$" > /dev/null; then echo " latest snapshot, $snapshot_latest, exists lets proceed with backup" >> /jobs/log/vrp.log 2>&1 time ssh root@$host zfs send -R -i $snapshot_latest $snapshot_current | zfs recv -Fv $destination >> /jobs/log/vrp.log 2>&1 echo " VRP Incremental Backup Complete " >> /jobs/log/vrp.log 2>&1 ssh root@$host zfs destroy -r $snapshot_latest ssh root@$host zfs rename $snapshot_current $snapshot_latest exit 0 else echo " missing latest snapshot aborting, $snapshot_latest" >> /jobs/log/vrp.log 2>&1 time ssh root@$host zfs send $snapshot_current | zfs recv -Fv $destination >> /jobs/log/vrp.log 2>&1 echo " VRP Full backup complete " >> /jobs/log/vrp.log 2>&1 ssh root@$host zfs rename $snapshot_current $snapshot_latest exit 1 fi
<script log>
Code:
Wed May 20 10:41:34 CST 2015 VRP Start taking current snapshot, vol/Customer_Environment@2015-05-20-10-41 latest snapshot, vol/Customer_Environment@latest, exists lets proceed with backup attempting destroy vol/Customer_Environment@latest success attempting rename vol/Customer_Environment@2015-05-20-10-15 to vol/Customer_Environment@latest success attempting destroy vol/Customer_Environment@auto-20150520.1040-2w success receiving incremental stream of vol/Customer_Environment@2015-05-20-10-41 into vol/Customer_Environment@2015-05-20-10-41 Unsupported share protocol: 1. received 153KB stream in 1 seconds (153KB/sec) VRP Incremental Backup Complete
Last edited: