Improved default speed variable name.

This commit is contained in:
Otho 2023-01-16 22:58:23 -05:00
parent a8cc409180
commit 5c2907e5e8
Signed by: Otho
GPG Key ID: 16C720CD3BBE21D9

View File

@ -1,5 +1,7 @@
#!/usr/bin/env sh
# requires zfs, pv, ssh
nodes_file="nodes.txt"
### nodes.txt
# <origin host> <user> <ssh port> <timezone> <compressed flag>
@ -22,7 +24,7 @@ ZFS_SEND_OPTS="-pRLe"
ZFS_SNAPSHOT_OPTS="-r"
ZFS_RECV_OPTS="-vsu"
SSH_SEND_OPTS="-Ti ~/.ssh/id_rsa"
DEF_SPEED="20M"
DEFAULT_SPEED="20M"
read LOCAL_HOST LOCAL_USER LOCAL_PORT LOCAL_TZ SEND_COMPRESSED < $nodes_file
@ -218,7 +220,7 @@ send_latest()
debug "Processing $dset (remote $rset)."
snap1=`get_latest_snapshot $dset`
send_cmd="zfs send $ZFS_SEND_OPTS $dset@$snap1"
pv_cmd="pv -qL ${speed:-$DEF_SPEED}"
pv_cmd="pv -qL ${speed:-$DEFAULT_SPEED}"
recv_cmd="zfs recv $ZFS_RECV_OPTS $zroot$rset"
run_send_recv
done
@ -241,7 +243,7 @@ send_increment()
snap1=`get_latest_snapshot`
snap0=`get_latest_remote_snapshot`
send_cmd="zfs send $ZFS_SEND_OPTS -i $dset@$snap0 $dset@$snap1"
pv_cmd="pv -qL ${speed:-$DEF_SPEED}"
pv_cmd="pv -qL ${speed:-$DEFAULT_SPEED}"
recv_cmd="zfs recv $ZFS_RECV_OPTS $zroot$rset"
run_send_recv
done