ClamAV can be useful for things like scanning a web root for viruses. Use this handy script with a cron job to setup nightly scans that send an email report.
1 |
https://code.google.com/p/clamav-cron/ |
Follow the directions on the site to install. We’ve modified the last line of the script so that it will work properly. Comment out the last line in /usr/local/bin/clamav-cron and add the following line to fix portion of the script that sends email. Make sure mailx is installed.
1 |
cat $CV_LOGFILE | /bin/mailx -s "$CV_SUBJECT" -r $CV_MAILFROM $CV_MAILTO |
You can use crontab -e to open up the cron editor and add the following entry:
1 |
0 3 * * * /usr/local/bin/clamav-cron /var/www/vhosts |
This tells ClamAV to scan /var/www/vhosts each morning at 3am and send an email report.