Thursday, October 13, 2005

Fresh Clam at Midnight Daily

Every now and then, I've been using ClamAV to scan my system for viruses, but I figured I should add a cron job to do it automatically. Assuming you have installed the "clamav" package, you can enter the following in the terminal to bring up the crontab file for editing.

export EDITOR=gedit && sudo crontab -e

Scroll to the end of the file. We're going to append the line below.

00 00 * * * sudo clamscan -r /

This tells ClamAV to scan all files/folders at midnight each day. 00 00 specifies minute 00 of hour 00. The three asterisks act as wild cards but could be used to specify day, month and year, respectively. All we have to do now is save the edited file.

No comments: