freshclam should be run at least every hour
clamav releases updated definitions many times a day, we should update them more often than daily.
#1 Updated by Filippo Carletti about 6 years ago
- Target version set to v6.5-beta3
- Affected version set to v6.4-beta2
We could add our update script to the cron hourly directory or link the script coming from the clamav-db package in cron.daily.
If we add our script we could add some random delay inside the script to reduce the load on clamav mirrors.
We could also add a script in cron.d.
#2 Updated by Giacomo Sanchietti about 6 years ago
- Status changed from NEW to TRIAGED
- % Done changed from 0 to 20
The random interval it's a best practice to avoid load on remote servers.
Proposed implementation: /etc/cron.hourly/freshclam-random
#!/bin/bash /bin/sleep $[ $RANDOM % 900 ] && /etc/cron.daily/freshclam
#6 Updated by Giacomo Sanchietti about 6 years ago
- Status changed from MODIFIED to ON_QA
- Assignee deleted (
- % Done changed from 60 to 70
freshclam-random script is launched each hour. See
#7 Updated by Filippo Carletti almost 6 years ago
- Status changed from ON_QA to TRIAGED
- Assignee set to Filippo Carletti
- % Done changed from 70 to 20
After updating freshclam is run every hour, but I suspect that the random sleep is expressed in seconds instead of minutes.
/bin/sleep $[ $RANDOM % 5 ] && exec /etc/cron.daily/freshclam
Evidence from logs that freshclam is run every hour:
Jan 29 18:06:57 Updated: nethserver-antivirus-1.0.5-1.0git6838bd73.ns6.noarch
Jan 29 19:01:01 nsrv64a2 run-parts(/etc/cron.hourly): starting freshclam-random
Jan 29 19:01:08 nsrv64a2 run-parts(/etc/cron.hourly): finished freshclam-random
ClamAV update process started at Wed Jan 29 19:01:05 2014
#12 Updated by Giacomo Sanchietti almost 6 years ago
- Status changed from ON_QA to VERIFIED
- Assignee deleted (
- % Done changed from 70 to 90
Freshclam is correctlry started by cron:
Jan 19 09:23:02 localhost run-parts(/etc/cron.daily): starting freshclam Jan 19 09:23:10 localhost run-parts(/etc/cron.daily): finished freshclam
Marking as VERIFIED.