Improved some command formats.

This commit is contained in:
Otho 2023-01-16 22:55:02 -05:00
parent cbf26b68bd
commit a8cc409180
Signed by: Otho
GPG Key ID: 16C720CD3BBE21D9

View File

@ -41,10 +41,11 @@ debug()
run_send_recv()
{
ssh_cmd="ssh $SSH_SEND_OPTS -o port=$port $user@$addr"
if [ $ZB_TEST_MODE = "TRUE" ]; then
echo "$send_cmd | $pv_cmd | $recv_cmd"
echo "$send_cmd | $pv_cmd | $ssh_cmd $recv_cmd"
else
$send_cmd | $pv_cmd | $recv_cmd
$send_cmd | $pv_cmd | $ssh_cmd $recv_cmd
fi
}
@ -158,7 +159,8 @@ get_latest_remote_snapshot()
*) zroot="$zroot/" ;;
esac
fi
remote_cmd="zfs list -t snapshot $zroot$dset|tail -n1|cut -d'@' -f2|cut -d' ' -f 1"
list_cmd="zfs list -t snapshot $zroot$dset"
remote_cmd="$list_cmd|tail -n1|cut -d'@' -f2|cut -d' ' -f 1"
run_remote
}
@ -217,7 +219,7 @@ send_latest()
snap1=`get_latest_snapshot $dset`
send_cmd="zfs send $ZFS_SEND_OPTS $dset@$snap1"
pv_cmd="pv -qL ${speed:-$DEF_SPEED}"
recv_cmd="ssh $SSH_SEND_OPTS -o port=$port $user@$addr zfs recv $ZFS_RECV_OPTS $zroot$rset"
recv_cmd="zfs recv $ZFS_RECV_OPTS $zroot$rset"
run_send_recv
done
done < sendnodes.tmp
@ -240,8 +242,7 @@ send_increment()
snap0=`get_latest_remote_snapshot`
send_cmd="zfs send $ZFS_SEND_OPTS -i $dset@$snap0 $dset@$snap1"
pv_cmd="pv -qL ${speed:-$DEF_SPEED}"
recv_cmd="ssh $SSH_SEND_OPTS -o port=$port $user@$addr \
zfs recv $ZFS_RECV_OPTS $zroot$rset"
recv_cmd="zfs recv $ZFS_RECV_OPTS $zroot$rset"
run_send_recv
done
done < sendnodes.tmp