find -exec surprisingly slow

Paul A. Hoadley paulh at logicsquad.net
Sat Aug 14 16:01:51 PDT 2004


Hello,

I'm in the process of cleaning a Maildir full of spam.  It has
somewhere in the vicinity of 400K files in it.  I started running
this yesterday:

find . -atime +1 -exec mv {} /home/paulh/tmp/spam/sne/ \;

It's been running for well over 12 hours.  It certainly is
working---the spams are slowly moving to their new home---but it is
taking a long time.  It's a very modest system, running 4.8-R on a
P2-350.  I assume this is all overhead for spawning a shell and
running mv 400K times.  Is there a better way to move all files based
on some characteristic of their date stamp?  Maybe separating the find
and the move, piping it through xargs?  It's mostly done now, but I
will know better for next time.


-- 
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040815/837c1603/attachment.bin


More information about the freebsd-questions mailing list