/[sysadmin-cookbook]/recepies/zfs/zfs-send-snapshot.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/zfs/zfs-send-snapshot.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 113 - (show annotations)
Thu Jun 18 12:56:56 2009 UTC (14 years, 11 months ago) by dpavlin
File MIME type: application/x-sh
File size: 441 byte(s)
send snapshot using netcat with nice info using dd_rescue

1 #!/bin/sh -x
2
3 fs=`zfs list | grep @ | iselect -t "select snapshot to send over netcat $veid" -a | sed 's/ .*$//'`
4
5 if [ -z "$fs" ] ; then
6 exit;
7 fi
8
9 nopool=`echo $fs | cut -d/ -f2-`
10
11 ip=`ifconfig | awk '/inet addr/ {split ($2,A,":"); print A[2]}' | grep -v 127.0.0.1 | head -1`
12
13 echo -e "\n\nStart receiving side with:\n\nnc -w 5 $ip 8888 | dd_rescue - - | zfs receive \`hostname\`/$nopool\n\n"
14
15 zfs send $fs | dd_rescue - - | nc -l -p 8888

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26