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.

No, using xargs to pass the files to clamscan works, but only sends about 200 file names at a time, forcing clamscan to reload every 200 files.

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.

xargs takes care of this already, but the reload time of clamscan is still too large compared to the actual scanning time, in my opinion.

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).

Running clamdscan would take care of the reload problem, but I don't want to run clamd as root, because I already have it running as a specific user for scanning incoming mail.

--
Chris

_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html

Reply via email to