Install ClamAV antivirus in Ubuntu Server and Client With Cron job
sudo apt-get install clamav clamtksudo apt-get install clamav clamav-daemonsudo dpkg-reconfigure clamav-base
sudo freshclam
sudo /etc/init.d/clamav-daemon start#!/bin/sh
# emtpy the old scanlog and do a virus scan
rm -R /home/root/clamav/clamav-scan.log
touch /home/root/clamav/clamav-scan.log
clamdscan /home/ /etc/ /opt/ --fdpass --log=/home/root/clamav/clamav-scan.log --infected --multiscan
### Send the email
if grep -rl 'Infected files: 0' /home/root/clamav/clamav-scan.log
then echo "No virus found inside /home."
else cat /home/root/clamav/clamav-scan.log | mail -s "Virus warning inside folder /home" root
fiPreviousMySQL Bin Files Eating Lots of Disk Space (fix)Next404 hyperlink not working after wordpress migration
Last updated