On Sep 12, 2012, at 12:44 PM, Edward Ned Harvey 
<opensolarisisdeadlongliveopensola...@nedharvey.com> wrote:

> I send a replication data stream from one host to another. (and receive).
> I discovered that after receiving, I need to remove the auto-snapshot 
> property on the receiving side, and set the readonly property on the 
> receiving side, to prevent accidental changes (including auto-snapshots.)
> Question #1:  Actually, do I need to remove the auto-snapshot on the 
> receiving side?  


> Or is it sufficient to simply set the readonly property?  


> Will the readonly property prevent auto-snapshots from occurring?


> So then, sometime later, I want to send an incremental replication stream.  I 
> need to name an incremental source snap on the sending side...  which needs 
> to be the latest matching snap that exists on both sides.
> Question #2:  What's the best way to find the latest matching snap on both 
> the source and destination?  At present, it seems, I'll have to build a list 
> of sender snaps, and a list of receiver snaps, and parse and search them, 
> till I find the latest one that exists in both.  For shell scripting, this is 
> very non-trivial.

Actually, it is quite easy. You will notice that "zfs list -t snapshot" shows 
the list in
creation time order. If you are more paranoid, you can get the snapshot's 
creation time from the "creation" property. For convenience, "zfs get -p 
creation ..."
will return the time as a number. Something like this:
for i in $(zfs list -t snapshot -H -o name); do echo $(zfs get -p -H -o value 
creation $i) $i; done | sort -n

 -- richard

illumos Day & ZFS Day, Oct 1-2, 2012 San Fransisco 

zfs-discuss mailing list

Reply via email to