Sunday, March 25, 2007

Installing ClamAV (Clam Antivirus) in linux (CentOS) - Part 3

To scan linux filesystem or all the mounted filesystems for viruses/worms(if any) on daily basis. Create a directory to hold the scanning script and quarantine folder
[root@localhost ~]# mkdir -pv /clam/quarantine
mkdir: created directory `/clam'
mkdir: created directory `/clam/quarantine'


Create a bash script to ease the daily virus scanning process.<
[root@localhost ~]# cd /clam
[root@localhost clam]# vi clamscan_report.sh
Put the following content in the script
#!/bin/bash
clamscan --move=/clam/quarantine/ -ril /clam/clamscan_report.txt /
Give it executible permission so that cron is able to execute it.
[root@localhost clam]# chmod u+x clamscan_report.sh
Now open up the crontab file and put this entry
55 7 * * * root /clam/clamscan_report.sh
at the below of the crontab file. Do not forget to keep running your system at 07:55 (7:55 AM) so cron will run the virus scan.

No comments: