| Revision 114 (by dpavlin, 2009/06/18 13:07:29) |
dd_rescue don't like sync on stdin/stdout
|
#!/bin/sh -x
fs=`zfs list | grep @ | iselect -t "select snapshot to send over netcat $veid" -a | sed 's/ .*$//'`
if [ -z "$fs" ] ; then
exit;
fi
nopool=`echo $fs | cut -d/ -f2-`
ip=`ifconfig | awk '/inet addr/ {split ($2,A,":"); print A[2]}' | grep -v 127.0.0.1 | head -1`
echo -e "\n\nStart receiving side with:\n\nnc -w 5 $ip 8888 | dd_rescue -y 0 - - | zfs receive \`hostname\`/$nopool\n\n"
zfs send $fs | dd_rescue -y 0 - - | nc -l -p 8888