Rather having to write something like: #!/bin/bash TIME=`date ''+%Y-%m-%d-%H:%M:%S''` zfs snapshot -r ztank@$TIME for i in `zfs list -H | grep $TIME | cut -f1` ; do zfs send $i | ssh ihstore zfs receive -d tank/sstore-ztank ; done That is just a first run, I''ll need to add a a touch /ztank/.LASTSEND+$TIME file and do some parsing and stuff to make it all incremental. It would be much nicer to do something like: zpool snapshot ztank@$TIME zpool send -i ztank@$LAST ztank@$TIME | ssh BACKUPHOST zpool receive remote-tank/ztank-backup then another pool on the same machine to same backup pool on the remote machine. zpool snapshot mtank@$TIME zpool send -i mtank@$LAST mtank@$TIME | ssh BACKUPHOST zpool receive remote-tank/mtank-backup Possible or is this going to break the zfs model? Nicholas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070413/c779a4d2/attachment.html>
You want: 6421958 want recursive zfs send (''zfs send -r'') Which is actively being worked on. - Eric On Fri, Apr 13, 2007 at 05:41:38PM +1200, Nicholas Lee wrote:> Rather having to write something like: > > #!/bin/bash > > TIME=`date ''+%Y-%m-%d-%H:%M:%S''` > zfs snapshot -r ztank@$TIME > > for i in `zfs list -H | grep $TIME | cut -f1` ; do > zfs send $i | ssh ihstore zfs receive -d tank/sstore-ztank ; > done > > That is just a first run, I''ll need to add a a touch /ztank/.LASTSEND+$TIME > file and do some parsing and stuff to make it all incremental. > > It would be much nicer to do something like: > > zpool snapshot ztank@$TIME > zpool send -i ztank@$LAST ztank@$TIME | ssh BACKUPHOST zpool receive > remote-tank/ztank-backup > > then another pool on the same machine to same backup pool on the remote > machine. > > zpool snapshot mtank@$TIME > zpool send -i mtank@$LAST mtank@$TIME | ssh BACKUPHOST zpool receive > remote-tank/mtank-backup > > > Possible or is this going to break the zfs model? > > Nicholas> _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
On 4/13/07, Eric Schrock <eric.schrock at sun.com> wrote:> > You want: > > 6421958 want recursive zfs send (''zfs send -r'') > > Which is actively being worked on.Exactly. :D "Perhaps they all have to have the same snapnames (which will be easier with ''zfs snapshot -r'')." Maybe just assume that anyone who wants to use send -r must implicit have run snapshot -r. So just ignore the ''snapshot -r'' and have a complete snapsend -r. Nicholas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070413/18f01896/attachment.html>
While I would really like to see a zpool dump and zpool restore so that I could throw a whole pool to tape it is not hard to script the recursive zfs send / zfs receive. I had to when I had to recover my laptop. http://blogs.sun.com/chrisg/entry/recovering_my_laptop_using_zfs --chris This message posted from opensolaris.org
On 4/15/07, Chris Gerhard <chris.gerhard at sun.com> wrote:> > While I would really like to see a zpool dump and zpool restore so that I > could throw a whole pool to tape it is not hard to script the recursive zfs > send / zfs receive. I had to when I had to recover my laptop. > > http://blogs.sun.com/chrisg/entry/recovering_my_laptop_using_zfsI''ve been working on something similar: #!/bin/bash if [ $# -lt 1 ]; then echo "Usage: $0 tank" exit 0 fi TANK=$1 DSTN="tank/sstore" TIME=`date ''+%Y-%m-%d-%H:%M:%S''` zfs snapshot -r $TANK@$TIME for i in `zfs list -H | grep $TIME | cut -f1` ; do FS=`echo $i | cut -f1 -d''@''` LAST=`ssh ihstore zfs list -Ho backups:lastsend $DSTN/$FS 2> /dev/null` if [ $? == 1 ]; then echo "New $FS to $i" echo " zfs send $i | ssh ihstore zfs receive -v -d $DSTN/$TANK" zfs send $i | ssh ihstore zfs receive -v -d $DSTN/$TANK ERR=$? if [ $ERR != 0 ]; then echo "Error: $ERR for $i"; continue ; fi ssh ihstore zfs set backups:lastsend=$i $DSTN/$FS continue else echo "$FS from $LAST to $i" echo " zfs send -i $LAST $i | ssh ihstore zfs receive -F $DSTN/$i" zfs send -i $LAST $i | ssh ihstore zfs receive -v -F $DSTN/$i ERR=$? if [ $ERR != 0 ]; then echo "Error: $ERR for $i"; continue ; fi ssh ihstore zfs set backups:lastsend=$i $DSTN/$FS fi echo " zfs destroy $LAST" zfs destroy $LAST echo "done: $i" echo "" done -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070415/9c1dbc7a/attachment.html>