3 source_disk
=/dev
/disk0s4
4 host='huxs@lab.luo-lab.org'
5 host_image
=/share
/users
/huxs
/t
/disk0s4.img
8 if ! ssh -p2211 "$host" "test -e '$host_image'"; then
12 ssh -p2211 "$host" "stat -c '%s' '$host_image'"
15 #echo $(( $(blockdev --getsz $source_disk) * 512 ))
16 echo `diskutil info $source_disk|grep 'Total Size'|awk '{print $5}'|sed 's/(//'`
19 echo "$(bytes_total) to $(bytes_transferred)"
21 while (( $
(bytes_transferred
) < $
(bytes_total
) )); do
22 ( dd bs
=1 skip
=$
(bytes_transferred
) count
=0 2>/dev
/null
&& cat ) < $source_disk |
ssh -p2211 -T -c arcfour
-o Compression
=yes -x "$host" "cat >> '$host_image'"