Hi, script parameter and container parameter customisation sshould be enough.
ClamAV scans whatever it finds in the Docker container's internal /scan folder, which usually is mapped to external folder /mnt/user. If you change that container parameter to e.g. /mnt/cache (assuming "standard" naming), then you can direct the container to scan the cache.
Now, if you want to scan the cache completely, you don't need my script. Just point the container to the cache as above and run the container. This one-liner starts the scan:
docker start ClamAV
Put that into a user script, schedule it daily and you're done.
If you want the folder selection or those fancy notifications, then continue. ->
To modify the script, there are more parameters in the script to customise. Find this block:
#Technical parameters
# name of the container.
CONTAINER=ClamAV
# Location of ClamAV application data folder in Unraid host.
# Must match with container parameter "ClamAV Signatures:"
HOSTAPPDATA=/mnt/user/appdata/clamav
# Location of scanned directory.
# Must match with container parameter "Folder to Scan:"
HOSTSCANDIR=/mnt/user
...
and customize the script too. The script parameter HOSTSCANDIR must match with the container parameter. Change "HOSTSCANDIR=/mnt/user" to "HOSTSCANDIR=/mnt/cache".
Put into FOLDERSDAILY and FOLDERSWEEKLY directories right under /mnt/cache, e.g. FOLDERSDAILY="domains isos" .
If you want to run both user shares and directories under cache, it's getting more complex. There are two options:
If you want to scan both /mnt/cache and /mnt/user completely, then set the scan point to /mnt and set FOLDERSDAILY and FOLDERSWEEKLY to "cache user" . We just moved here one step higher in folder hierarchy.
If you want to scan subsets in both, then you have to duplicate the ClamAV container and script and customise them independently. In the second script you have to change CONTAINER and HOSTAPPDATA to match the second container. (Actually i don't yet know how that's done in Unraid, i'm Unraid noob).
The script prints some debugging info. You'll see that if you run the script interactively with User Script plugin. It verifies that the folders actually exist and prints what it finds and finds not. If the scan takes long time, you can safely stop the script, but remember to stop the ClamAV container too.