On Tue, Nov 28, 2006 at 02:19:22PM -0800, Todd Lyons wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, Nov 28, 2006 at 05:55:44PM -0300, René Bellora wrote: > > >this could be circumvented with xargs: > >cd /tmp/clamscan > >find . -type f -print0 | xargs -0 clamscan > > If clamscan is complaining about a too long commandline with *, then > this will give him the same error. > > The problem with not using -print0 is that clamscan gets instatiated for > each file, and it will unpack and reload the virus database everytime > it's instantiated. Not good for efficiency or load. > > The only solutions as I see it when you get to long enough lists is: > 1) write a script that generates the list and feeds it to clamscan in > batches of 100 or 1000 or whatever number you deem reasonable. > 2) configure clamd to run as root and then use clamdscan instead of > clamscan (why root? Because files are likely owned by several different > users). > - -- > Regards... Todd
Not quite...xargs will break up the argument list in to hunks that won't overflow the command-line buffer. clamscan will only be invoked the number of times it takes to break up the arguments in order to not overflow the command-line buffer. Thanks, Josh -- Josh Tolbert [EMAIL PROTECTED] || http://www.puresimplicity.net/~hemi/ Security is mostly a superstition. It does not exist in nature, nor do the children of men as a whole experience it. Avoiding danger is no safer in the long run than outright exposure. Life is either a daring adventure, or nothing. -- Helen Keller _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html