Automatically Update the ClamAV Virus Database

December 6, 2008 by
Filed under: HowTo, linux, security, Ubuntu 

ClamAV is a virus scanner for Linux and Unix systems.

To install it on Ubuntu you can use Synaptic or install it from the command line using apt-get.

sudo apt-get install clamav

Once it's installed you can set up a script for right click virus scanning in Nautilus.

To update the virus database, open a terminal and enter the following command:

Affiliate Link
sudo freshclam

To automate this update you can set up a cron job. I'll show how to update the virus database every day at 8:57 PM. First, open the terminal and su to root.

sudo su

Now you need to modify the crontab for the root user.

crontab -e

This opens the root crontab file in the nano text editor. Add the following line to the crontab and then hit Ctrl+X to exit. Answer yes when prompted to save the file.

57 20 * * * /usr/local/bin/freshclam --quiet

That's it. ClamAV will now update every day at 8:57 PM. For more information about ClamAV, see the ClamAV User Manual.

Comments

2 Responses to “Automatically Update the ClamAV Virus Database”

  1. Kiernan says:

    BTW, make sure to do a "which freshclam" before entering the crontab editor,
    the path may not be /usr/local/bin/freshclam .

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>