Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Virus databae upate

Tharanga Rajapaksha edited this page Jun 19, 2019 · 12 revisions

Clam AV upate automatically

Basic guide

Clamav database regular update is very important for the security prepose of the system. So there is a cron job to update it daily. How it works is described in this page.

clamav can be updated by following command.

freshcalam

Then output will be

root@email:/# freshclam
Wed Jun 19 08:49:45 2019 -> ClamAV update process started at Wed Jun 19 08:49:45 2019
Wed Jun 19 08:49:45 2019 -> ^Your ClamAV installation is OUTDATED!
Wed Jun 19 08:49:45 2019 -> ^Local version: 0.100.3 Recommended version: 0.101.2
Wed Jun 19 08:49:45 2019 -> DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
Wed Jun 19 08:52:14 2019 -> Downloading main.cvd [100%]
Wed Jun 19 08:56:03 2019 -> main.cvd updated (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Wed Jun 19 08:56:24 2019 -> *Can't query main.58.93.1.0.6810DA54.ping.clamav.net
Wed Jun 19 08:57:19 2019 -> Downloading daily.cvd [100%]
Wed Jun 19 09:02:00 2019 -> daily.cvd updated (version: 25484, sigs: 1596295, f-level: 63, builder: raynman)
Wed Jun 19 09:02:20 2019 -> *Can't query daily.25484.93.1.0.6810DA54.ping.clamav.net
Wed Jun 19 09:02:21 2019 -> Downloading bytecode.cvd [100%]
Wed Jun 19 09:02:31 2019 -> bytecode.cvd updated (version: 328, sigs: 94, f-level: 63, builder: neo)
Wed Jun 19 09:02:51 2019 -> *Can't query bytecode.328.93.1.0.6810DA54.ping.clamav.net
Wed Jun 19 09:03:40 2019 -> Database updated (6162638 signatures) from db.local.clamav.net (IP: 104.16.218.84)
Wed Jun 19 09:03:40 2019 -> ^Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.ctl: No such file or directory
root@email:/# 

Once the process completed you may check the log file in following location.

cd /var/log/clamav

more freshclam

It will be like this.

root@email:/var/log/clamav# more freshclam.log
Wed Jun 19 08:49:45 2019 -> --------------------------------------
Wed Jun 19 08:49:45 2019 -> ClamAV update process started at Wed Jun 19 08:49:45 2019
Wed Jun 19 08:49:45 2019 -> WARNING: Your ClamAV installation is OUTDATED!
Wed Jun 19 08:49:45 2019 -> WARNING: Local version: 0.100.3 Recommended version: 0.101.2
Wed Jun 19 08:49:45 2019 -> DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
Wed Jun 19 08:52:14 2019 -> Downloading main.cvd [100%]
Wed Jun 19 08:56:03 2019 -> main.cvd updated (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Can't query main.58.93.1.0.6810DA54.ping.clamav.net
Wed Jun 19 08:57:19 2019 -> Downloading daily.cvd [100%]
Wed Jun 19 09:02:00 2019 -> daily.cvd updated (version: 25484, sigs: 1596295, f-level: 63, builder: raynman)
Can't query daily.25484.93.1.0.6810DA54.ping.clamav.net
Wed Jun 19 09:02:21 2019 -> Downloading bytecode.cvd [100%]
Wed Jun 19 09:02:31 2019 -> bytecode.cvd updated (version: 328, sigs: 94, f-level: 63, builder: neo)
Can't query bytecode.328.93.1.0.6810DA54.ping.clamav.net
Wed Jun 19 09:03:40 2019 -> Database updated (6162638 signatures) from db.local.clamav.net (IP: 104.16.218.84)
Wed Jun 19 09:03:40 2019 -> WARNING: Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.ctl: No such file or directory
root@email:/var/log/clamav# 

How to enable virus update to work daily.

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

57 08 * * * freshclam

How to do above steps from one command line.

crontab -l | { cat; echo "57 08 * * * freshclam"; } | crontab -

Clamav also has it's own configuration to set daily update times.

vim /etc/clamav/freshclam.conf
Checks 24
##Notify clamd to reload it self
NotifyClamd /etc/clamav/clamd.conf

Cron Task : Create Cron task Cron job pattern

Clone this wiki locally