Automatically Update the ClamAV Virus Database

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:

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.

2 thoughts on “Automatically Update the ClamAV Virus Database

  1. Kiernan

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

    Reply

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.