How can I run an antivirus s/w as a cron job to check for virus on a particular set of folders on my server(Apache, Drupal) where I store the files retrieved from users?

Any ideas?

link|improve this question
1  
What antivirus software? – voretaq7 Oct 7 '11 at 19:51
Sorry.. I have not decided on it yet.. I am open to suggestions even in this case.. – Neal Oct 7 '11 at 19:58
1  
What operating system? – John Gardeniers Oct 7 '11 at 21:08
feedback

2 Answers

Install ClamAV and set the cron job to run clamscan /path/to/folder

link|improve this answer
That would be my suggestion if you're on a *nix box. I'd go one step more though and say move the files to a "clean" folder after they're scanned so you're not always re-scanning the same files. – voretaq7 Oct 7 '11 at 20:09
Note that there may be some value to periodic rescanning of "clean" files: over time, zero-day threats become known threats. – Miles Erickson Oct 7 '11 at 20:39
feedback

You'll need to install an AV client which supports command line arguments and some form of script-able definition and executable update.

AVG and Clam can do this - you need to decide which is more suitable for you.

You may want to reconsider using CRON to launch a virus scan, and instead use a directory change trigger, which launches the scan as the new file is created. A perl module is available as an example.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.