Here's my script "real time" clamav :
Code: Select all
FOLDER=/home
QUARANTINE=/tmp
LOG=$HOME/.clamav-tr.log
while :
do
inotifywait -q -m -r -e create,modify,move,delete,open,close,access "$FOLDER" --format '%w%f|%e' | sed --unbuffered 's/|.*//g' |
while read FICHIER; do
clamdscan --quiet --no-summary -i -m "$FILE" --move=$QUARANTINE
if [ "$?" == "1" ]; then
echo "`date` - Malware found in the file '$FILE'. The file has been moved to $QUARANTINE." >> $LOG
echo -e "\033[31mMalware found!!!\033[00m" "The file '$FILE' has been moved to quarantine."
if [ -f /usr/bin/notify-send ]; then
notify-send -u critical "Real Time ClamAV" "Malware found!!! Le fichier '$FILE' moved to quarantine."
fi
fi
done
done
But now clamd is using a lot of CPU. Sometimes it goes up to 82%.
I know that my processor is very bad (AMD Dual-Core Processor E-350). But is anything can be done to reduce CPU and improve overall system performance?
Any idea?
Thanks in advance.