X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=zfs-replicate;h=347bcbe4ad4223872e5450d0b509ebb6d0d88b5c;hb=3829caa2e99fcf28afe3004c367ce19ab86d2274;hp=c7e7c2faa191e30517683605a4258f3fd59608ee;hpb=ecd17901ea99621f02c6531d1cdd146666f30ce8;p=zfs-ubuntu%2F.git diff --git a/zfs-replicate b/zfs-replicate index c7e7c2f..347bcbe 100755 --- a/zfs-replicate +++ b/zfs-replicate @@ -177,8 +177,13 @@ if [ $no_markers == 0 ]; then fatal_and_exit "-E- remote incremental $zfs rollback command failed" $mailto fi # Now it should be safe to send the snaps - ssh $remote $zfs send -R -I${previous_backup_marker} ${current_backup_marker} | - $zfs receive -vF -d ${local_pool}/${remote_pool} + if [[ $throttle_enable == 1 && -e $throttle ]]; then + ssh $remote $zfs send -R -I${previous_backup_marker} ${current_backup_marker} | + $throttle $throttle_opt | $zfs receive -vF -d ${local_pool}/${remote_pool} + else + ssh $remote $zfs send -R -I${previous_backup_marker} ${current_backup_marker} | + $zfs receive -vF -d ${local_pool}/${remote_pool} + fi if [ $? != 0 ]; then fatal_and_exit "-E- remote incremental $zfs send command failed" $mailto fi @@ -197,8 +202,13 @@ else if [[ -n "$common" ]]; then # We found a common snapshot, incrementally send the new snaps - ssh $remote $zfs send -R -I${common/*@/@} ${current_backup_marker} | - $zfs receive -vF -d ${local_pool}/${remote_pool} + if [[ $throttle_enable == 1 && -e $throttle ]]; then + ssh $remote $zfs send -R -I${common/*@/@} ${current_backup_marker} | + $throttle $throttle_opt | $zfs receive -vF -d ${local_pool}/${remote_pool} + else + ssh $remote $zfs send -R -I${common/*@/@} ${current_backup_marker} | + $zfs receive -vF -d ${local_pool}/${remote_pool} + fi if [ $? != 0 ]; then fatal_and_exit "-E- remote incremental $zfs send command failed" $mailto fi @@ -220,8 +230,13 @@ else fi fi # Send the full filesystem - ssh $remote $zfs send -R ${current_backup_marker} | - $zfs receive -vF -d ${local_pool}/${remote_pool} + if [[ $throttle_enable == 1 && -e $throttle ]]; then + ssh $remote $zfs send -R ${current_backup_marker} | + $throttle $throttle_opt | $zfs receive -vF -d ${local_pool}/${remote_pool} + else + ssh $remote $zfs send -R ${current_backup_marker} | + $zfs receive -vF -d ${local_pool}/${remote_pool} + fi if [ $? != 0 ]; then fatal_and_exit "-E- remote full $zfs send command failed" $mailto fi