How to Perform a Scheduled Virus Scan on Ubuntu 10.04 with Gnome-Schedule and ClamAV
- August 14th, 2010
- By Dean Harris
- Write comment
This post will help you set up scheduled virus scan on your Ubuntu box using Gnome-schedule and ClamAV.
While it is true that the direct threat of Viruses on Linux is (at present) limited, many users dual boot with Windows, share networks with Windows and other such things, and here our ’safe’ Linux box can be a carrier. Of course, with the increasing popularity of Linux on the desktop, I’m sure it’s only a matter of time before more and more virus start targeting our beloved Linux systems. As such, it is better to be safe than sorry…
To protect our Ubuntu box we shall be using the excellent ClamAv for our virus scanning and the equally excellent Gnome-schedule to automate the process.
Firstly open up a terminal and install our required software…
sudo apt-get install gnome-schedule
Okay, that everything installed. Let’s set everything up…
You should now have a new launcher under APPLICATIONS-SYSTEM TOOLS called Scheduled tasks.
Start Gnome Schedule and Click New and select the default option of ‘A task that launches recurrently’.
We are now going a task to scan our Home directory recursively every day at 12:00 AM and write a log file.
In the Description field type (or whatever you see fit):
Daily ClamAV Scan
Set the Time & Date option to Basic and select:
Every day
Set the Command Field to:
clamscan -r -i -l ClamAV-log.txt /home/harris/
(clamscan runs a ClamAV scan, -r sets the scan as recursive, -i only print infected files, -l ClamAV-log.txt creates a log file with that name, and /home/harris/ is the target of our scan.)
Your new task should look like this:
Click OK to accept the task and you should see your newly scheduled task in the schedulers list of tasks.
Now you can Quit the scheduler. This will not stop the system scheduling.
Things to be aware of!
You will need to keep your virus definitions up to date using the the following command:
ClamAV can only read files that the user running it can read. If you want to check all files on the system you must use sudo:
ClamAV is an excellent tool with many command parameters. To see what other options you can add have a look at the man pages:
Finally, if you wish to add a GUI to ClamAV take a look at
How to Install Clam AntiVirus with GTK frontend GUI




