clamav package (this one is for Arch)
You’ll need to make freshclam, the tool that updates the virus signature database, a daemon as well so the signatures to scan for stay up to date.
sudo systemctl start clamav-freshclam.service
sudo systemctl enable clamav-freshclam.service
The freshclam config file is in /etc/clamav/freshclam.conf
Now clamav(clamd) needs to be made a daemon.
sudo systemctl start clamav-daemon.service
sudo systemctl enable clamav-daemon.service
Logs for the daemon are found in /var/log/clamav/clamd.log
The clamd config file is in /etc/clamav/clamd.conf
By default, clamd will use 10 threads.
clamdscan is basically the same as clamscan except it uses the daemon. This makes it possible to make the scan multithreaded.
clamdscan --multiscan --fdpass /home/
The multiscan
option tells clamd to use multiple threads and the fdpass
option tells clamd to scan the file using the clamd user the daemon was started as.
when a scan is running, you can use clamdtop
to monitor the progress. It acts like htop but for clamav and will show how many files are being scanned, the queue for files to scan, how many threads are used, and other resources being used by the scan.
the daemons run on startup of my machine which is great. The scans now finish in 30 minutes using the daemon compared to the single thread scans of clamscan which would take many hours.
Setting up ClamD with SystemD
By Collin, 2023-08-08