On Wed, Feb 03, 2010 at 12:19:50PM -0500, Frank Cusack wrote:
> On February 3, 2010 6:02:52 PM +0100 Jens Elkner 
> <jel+...@cs.uni-magdeburg.de> wrote:
> >On Wed, Feb 03, 2010 at 10:29:18AM -0500, Frank Cusack wrote:
> >># newer files
> >>find /file/system -newer /file/system/.zfs/snapshot/snapname -type f
> >># deleted files
> >>cd /file/system/.zfs/snapshot/snapname
> >>find . -type f -exec "test -f /file/system/{} || echo {}" \;
> >>
> >>The above requires GNU find (for -newer), and obviously it only finds
> >>files.  If you need symlinks or directory names modify as appropriate.
> >>
> >>The above is also obviously to compare a snapshot to the current
> >>filesystem.  To compare two snapshots make the obvious modifications.
> >
> >Perhaps http://iws.cs.uni-magdeburg.de/~elkner/ddiff/ wrt. dir2dir cmp
> >may help as well (should be faster).
> 
> If you don't need to know about deleted files, it wouldn't be.  It's hard
> to be faster than walking through a single directory tree if ddiff has to
> walk through 2 directory trees.

Yepp, but I guess the 'test ...' invocation for each file alone is much
more time consuming and IIRC the test -f path has do do several stats
as well, 'til it reaches its final target. So a lot of overhead again.

However, just finding newer files via 'find' is probably unbeatable ;-)
 
> If you do need to know about deleted files, the find method still may
> be faster depending on how ddiff determines whether or not to do a
> file diff.  The docs don't explain the heuristics so I wouldn't want
> to guess on that.

ddiff is a single process and basically travels recursively through
directories via a DirectoryStream (side by side) and stops it at the
point, where no more information is required to make the final decision
(depends on cmd line options). So it needs for very deep dirs with a
lot of entries [much] more memory than find, yes.

Not sure, how DirectoryStream is implemented, but I guess, it gets
mapped to readdir(3C) and friends ...

Regards,
jel.
-- 
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to