I''m using "find" to run a directory scan to see which files have changed since the last snapshot was taken. Something like: zfs snapshot tank/filesystem at snap1 ... time passes ... find /tank/filesystem -newer /tank/filesystem/.zfs/snap1 -print Initially I assumed the time data on the .zfs/snap1 directory would reflect the time the snapshot was taken - but the time values were earlier than that. So I thought perhaps it was the time of the last filesystem modification, but now that seems not to be the case. The above "find" line is discovering files in the snapshot newer than the snapshot root directory which just seems odd. Please can anyone advise what time data is being used for the snapshot root directory? Also - please can anyone advise any better approach than grepping zpool history to find an accurate-to-the-second snapshot creation or filesystem modification time? I suppose I could encode the time in the snapshot name, but that feels clumsy. "zfs get creation" will only give me to the nearest minute. Appreciate any observations. Cheers Chris -- This message posted from opensolaris.org
On Fri, Aug 28, 2009 at 3:51 PM, Chris Baker<osol at lhc.me.uk> wrote:> I''m using "find" to run a directory scan to see which files have changed since the last snapshot was taken. Something like: > > zfs snapshot tank/filesystem at snap1 > ... time passes ... > find /tank/filesystem -newer /tank/filesystem/.zfs/snap1 -print > > Initially I assumed the time data on the .zfs/snap1 directory would reflect the time the snapshot was taken - but the time values were earlier than that. So I thought perhaps it was the time of the last filesystem modification, but now that seems not to be the case. The above "find" line is discovering files in the snapshot newer than the snapshot root directory which just seems odd. > > Please can anyone advise what time data is being used for the snapshot root directory?The timestamp of the root directory at the time the snapshot was taken?> Also - please can anyone advise any better approach than grepping zpool history to find an accurate-to-the-second snapshot creation or filesystem modification time? ?I suppose I could encode the time in the snapshot name, but that feels clumsy. "zfs get creation" will only give me to the nearest minute.''zfs get -p creation'' gives you seconds since the epoch, which you can convert using a utility of your choice. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
Try a: zfs get -pH -o value creation <snapshot> -- MikeE -----Original Message----- From: zfs-discuss-bounces at opensolaris.org [mailto:zfs-discuss-bounces at opensolaris.org] On Behalf Of Chris Baker Sent: Friday, August 28, 2009 10:52 AM To: zfs-discuss at opensolaris.org Subject: [zfs-discuss] Snapshot creation time I''m using "find" to run a directory scan to see which files have changed since the last snapshot was taken. Something like: zfs snapshot tank/filesystem at snap1 ... time passes ... find /tank/filesystem -newer /tank/filesystem/.zfs/snap1 -print Initially I assumed the time data on the .zfs/snap1 directory would reflect the time the snapshot was taken - but the time values were earlier than that. So I thought perhaps it was the time of the last filesystem modification, but now that seems not to be the case. The above "find" line is discovering files in the snapshot newer than the snapshot root directory which just seems odd. Please can anyone advise what time data is being used for the snapshot root directory? Also - please can anyone advise any better approach than grepping zpool history to find an accurate-to-the-second snapshot creation or filesystem modification time? I suppose I could encode the time in the snapshot name, but that feels clumsy. "zfs get creation" will only give me to the nearest minute. Appreciate any observations. Cheers Chris -- This message posted from opensolaris.org _______________________________________________ zfs-discuss mailing list zfs-discuss at opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Peter, Mike, Thank you very much, "zfs get -p" is exactly what I need (and why I didn''t see it despite having been through the man page dozens of times I cannot fathom.) Much appreciated. Chris -- This message posted from opensolaris.org