As root,
- install f-prot AV
make sure that you're updated
Code: Select all
emerge f-protdownload http://www.rexswain.com/eicar.com to your home folder, then make sure that it's working by (as per http://www.rexswain.com/eicar.html )Code: Select all
/opt/f-prot/check-updates.plNow let's script it. Create the file /usr/sbin/fprotscan with the following content:Code: Select all
/opt/f-prot/f-prot -disinf -list ~/Make it executableCode: Select all
#Script to automate virus scans and logging # #Get the system date and store some needed variables set `date` DAY=`echo $6$2$3` LOGDIR=~/f-prot # #Next, let's make sure that we're up-to-date /opt/f-prot/check-updates.pl -cron -quiet # #Mount /boot so it can be checked as well mount /boot # #Change to a predetermined log directory, create it if need be. if [ -d $LOGDIR ] then echo "Log folder exists.." cd $LOGDIR echo "Scanning...this may take awhile" else echo "Creating log folder..." mkdir $LOGDIR cd $LOGDIR echo "Scanning...this may take awhile" fi # #Run the virus scan...and log it. #Thanks for the help on this part in particular, guys! /opt/f-prot/f-prot -disinf -list -report=$DAY.log -append / # #Unmount /boot umount /bootNow, let's automate.Code: Select all
chmod a+x /usr/sbin/fprotscanInsert the following line, save, and exitCode: Select all
crontab -eThis will run your scan at 3:30 AM (when most people's computer's are otherwise idle) every day. Check here if you want to modify the schedule to run and don't understand cron.Code: Select all
30 3 * * * /usr/sbin/fprotscan
Regards,
JoeG



