Scanning for virus

October 24, 2008 | Leave a Comment

So now we have a backup system archiving our valuable data weekly. The problem is, these data come from different computers running different OS, some of them also come from friend’s computers or even the World Wide Web. The problem is that we can not guarantee that these files are virus free. But at least, we can scan them before we back them up. That’s why I created a script launching a virus scan every thursdays before we run the sunday backup. Not knowing which antivirus to use to detect windows-aiming virus I decided to go with Avast that I used when running Windows. Avast provides an Avast 4 Linux edition, free for home use.

The installation is straighforward: download the package from avast site then run:

1
dpkg -i avast....zip

The script is pretty simple too (feel free to help me improve it as well):

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
export now=$(date +"%Y-%m-%d")
export logPath=/var/log/avast/avastlogs-${now}.log
echo "########## Starting Antivirus Script #########" > ${logPath}
date >> ${logPath}
avast-update
avast /mnt/media/ --report ${logPath}
echo "########## End of Antivirus Script ##########">> ${logPath}
export content=$(cat ${logPath})
mail -s "weekly antivirus scan  completed" <email1>,<email2> <<  EOF
${content}
EOF

Then I added the task in cron:

1
0       1       *       *       4       sh /root/config/cron/virusscan.sh > /dev/null

Hopefully that will save us some troubles…


Comments

Name (required)

Email (required)

Website

Leave a Reply