Ah, it appears you're using an older version of clamdscan! It doesn't support the --exclude-dir and --recursive options the same way a newer version does. The warnings tell us that those flags are being ignored.
Here's what to do to adapt:
1. Upgrade ClamAV (Recommended)
The best solution is to upgrade to the latest ClamAV version. Newer versions support those options, and often have improved detection rates and features. The process depends on your distribution (Pop!_OS is based on Ubuntu, so):
sudo apt update
sudo apt upgrade clamav clamd
After upgrading, try the command again:
sudo clamdscan -r --fdpass --infected \
--exclude-dir=/dev \
--exclude-dir=/proc \
--exclude-dir=/sys \
--exclude-dir=/run \
--exclude-dir=/lost+found \
--exclude-dir=/boot \
--exclude-dir=/usr \
--exclude-dir=/lib \
--exclude-dir=/bin \
--exclude-dir=/sbin \
--exclude-dir=/etc \
--exclude-dir=/snap \
/home /var/www /tmp /root /media /mnt
If it works now, great! If not, continue to the adaptation steps.
2. Adapt the Command (Without --exclude-dir and -r)
If you cannot upgrade ClamAV, here's how to achieve a similar outcome using older flags, and a bit of scripting:
Since --exclude-dir is not supported you cannot prevent specific folders from being scanned, you will have to run a complete scan of the whole computer. The warnings say that -r is ignored, but since the directory paths are given, the full folder should still be scanned recursively.
So you can run this to scan all of your folders:
sudo clamdscan --fdpass --infected /home /var/www /tmp /root /media /mnt
Explanation:
sudo clamdscan: Runs ClamAV scanner as root.
--fdpass: Pass file descriptors instead of filenames to clamd.
--infected: Only display infected files.
/home /var/www /tmp /root /media /mnt: List of paths to scan.
🧹 Cleanup Steps
-
Remove the Old Command: Remove the old command with all the unsupported flags from your cron file (if you've added it).
-
Add the new command: Add the new command into your cron.
Important Considerations:
- Performance Impact: Without exclusions, your scan will take much longer. If you find it heavily impacts your system, you might need to scan less frequently. The more exclusions that there are the less the processing the software has to do.
- False Positives: Scanners sometimes flag normal files as threats, though rare. Examine any detections carefully to avoid deleting essential files.
- Resource Usage: Monitor CPU and I/O during the scan to ensure it's not overwhelming. Use
top, htop, or iotop.
This should get you scanning even with the older version. Let me know if you have more questions!