This is a custom script that allows a user to scan their ~/home
folder using a popular AntiVirus software available for Linux - ClamAV.
View the ClamAV Github page.
Follow the recommended installation steps for your distro on their documentation page.
For an interactive gui, also install their clamtk package.
E.g. Debian: $ sudo apt install clamav clamtk
-
Make sure this script is executable
$ chmod u+x ClamAVCron.sh
-
If you would like to invoke this script at any time from the terminal, or share with other users,
link it in /usr/local/bin (seerun-parts
)# ln -s /path/to/ClamAVCron.sh /usr/local/bin/clamscan-cron
-
Add the following line to your crontab using
crontab -e
:
Replace[period]
with number of days between scans. default: 7@hourly /usr/local/bin/clamscan-cron user [period] >/dev/null 2>&1
- Add list of directories to ignore (ie, node_modules, python_modules, .git, etc.)
- Should use tmp file for logfile until scan complete
- Change to sh for more portability
- Eventually fix notifications :/
- Command line arguments for more flexibility
- Multiple distro support - if necessary
- Show a progress notification? Sounds like a hack that won't be efficient. Maybe just change final notification to a summary.