How to scan share folder using Clamav
Friday, August 10, 2007 | Label: Linux | 2 komentar |At our office, we have a problem. Various viruses were detected in our Maxtor storage server. Yes, it's a public file server. And Maxtor didn't have any antivirus tool. So, the only solution is to mount it using Samba and scan it with Clamav.
How to do it?
First, create a folder where it's your mount point.
mkdir [Mount point]
2nd, mount your storage server using Samba
mount -t smbfs //[Maxtor IP address]/[Shared folder] /mnt/ [Mount point]/
3rd, put your mount point into fstab
//[MAxtor IP address]/[Shared folder] /mnt/ [Mount point] smbfs defaults 0 0
4th, if you want it to work automatically, just write the automatization into crontab
crontab -e
Put this line below into it,
00 07 * * * clamscan --move=/root/karantina -r /mnt/
00 11 * * * clamscan --move=/root/karantina -r /mnt/
00 15 * * * clamscan --move=/root/karantina -r /mnt/
00 19 * * * clamscan --move=/root/karantina -r /mnt/
*)
"karantina" is the folder name from which we move the infected file.
"--move=[Folder repository]" is the command to move the infected file into a specific folder.
Update :
Mbon, dah dibenerin :P