You're encountering that freshclam error because the ClamAV daemon is running, and it typically handles updates automatically. The freshclam process (run manually) tries to acquire a lock on the log file, but fails because it's already being used by the daemon—this is normal and doesn't necessarily mean the virus database isn't updating.
If you already have the clamd daemon running and updating via clamd, you don't need to manually run freshclam. But you can still run system scans manually any time using the clamscan or clamdscan tools.
✅ To run a manual system scan, choose one of the following:
1. Using clamscan (slower, doesn't use the daemon):
sudo clamscan -r --bell -i /
Explanation:
-r = recursive
--bell = beep when a virus is found (optional)
-i = only print infected files
/ = scan whole system (you can change this to scan /home, /etc, etc.)
2. Using clamdscan (faster, uses the daemon and shared memory if available):
sudo clamdscan -r --fdpass --infected /
Explanation:
-r = recursive
--fdpass = passes file descriptors for proper permission handling
--infected = only show infected files
Use clamdscan if the ClamAV daemon is properly configured—it’s faster because it uses a long-running service instead of starting a new scan engine each time like clamscan.
🗓️ Automate with cron or systemd
To run scans regularly, you can create a cron job like this:
sudo crontab -e
Add a line like:
0 3 * * * /usr/bin/clamdscan -r --fdpass --infected / > /var/log/clamav/daily-scan.log
This runs a scan every day at 3 AM. Adjust the path as needed for your CLI (which clamdscan to confirm location).
✅ Summary
- Don't worry about manual
freshclam errors when the daemon is running—it updates in the background.
- Use
clamdscan over clamscan for performance, since you have the daemon.
- Schedule regular scans using
cron and log the output.
Let me know if you’d like help making real-time alert scripts or logs!