rsync is nice, but when your talking 1 million files over 12 users,
your talking serious disk io.  45 minutes per user just to scan through
the list.

If I can determine if anything needs to be done at all first, before even running rsync, that's a lot of savings.
 
--- 
Wayne Johnson,                         | There are two kinds of people: Those 
3943 Penn Ave. N.          | who say to God, "Thy will be done," 
Minneapolis, MN 55412-1908 | and those to whom God says, "All right, 
(612) 522-7003                         | then,  have it your way." --C.S. Lewis


----- Original Message ----
From: Dave Sherohman <dave at sherohman.org>
To: tclug-list at mn-linux.org
Sent: Wednesday, January 9, 2008 4:57:04 PM
Subject: Re: [tclug-list] Finding the date of the newest file in a directory tree


On Wed, Jan 09, 2008 at 02:29:19PM -0800, Wayne Johnson wrote:
> Anyone know of a quick and easy way to find the date of the newest
> file in a directory tree.  

Not entirely "quick" when dealing with a million files, but

find /some/dir/ -exec ls -l {} \; | awk '{print $6,$7,$8}' | sort -r |
 head -1

will give you the newest file in /some/dir/ (or its subdirectories)
along with its modification date and time, assuming your ls lists the
date/time in an ascii-sortable format (which mine does: 2008-01-09
 00:28).

> I'm looking for a way to speed up synchronizing file caches between
> machines.  When you have 1m in files (that's a count, not a size), it
> takes quite a while to scan through the whole tree.  If we had a
> .oldest file in each branch, we could skip that branch if nothing had
> changed.  Then all we would need to do is scan the tree once to set
> these branch-stamps.  After that, all the cache machines would have
 to
> do is walk the tree looking for newer stamps.  

Have you tried rsync?  In broad terms, this is the kind of thing it's
designed to handle, but I'm not sure whether it's able to detect
unmodified directories and skip them or not.

-- 
I reckon we are now the only monastry ever that had a dungeon stuffed
 with
sixteen thousand zombies.
  - perlmonks.org

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list at mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list






      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20080109/1f5410a7/attachment.htm