Hi, After a long time we were able to successfully install clamav on our systems , on our ABAP systems we were able to use a script to allow us to be notified whenever a virus was found on the system,the latter was reported in a log that was then sent by mail to us, but now we are trying to create something similar on a JAVA system, on the JAVA system we have already located the log where the virus is reported by the ClamAV, now we would similarly like to create a script for the java that does the same as the script on the Abap systems, the biggest problem for now is that the log on which the Java writes is always the same,meaning that if we used the script we wouldn't be sure if it is a new virus or an old virus that has been on that log since forever, so my question is,do you know if there is some clamav setting to allow us to write different logs every time a virus is found? I’ll write the script we used on the abap system hoping it can help (if it can help you we are on clamav 0.103.7-3.21.2 and clamsap 0.104.3-3.12.1 Thanks! : #!/bin/bash LOGFILE="/var/log/clamd-$(date +'%Y-%m-%d').log"; EMAIL_MSG="Please see the log file attached."; EMAIL_FROM="clamav-da...@zambongroup.com"; EMAIL_TO=" antonio.galdi...@techedgegroup.com"; DIRTOSCAN="/tmp"; for S in ${DIRTOSCAN}; do DIRSIZE=$(du -sh "$S" 2>/dev/null | cut -f1); echo "Starting a daily scan of "$S" directory. Amount of data to be scanned is "$DIRSIZE"."; clamscan -ri "$S" >> "$LOGFILE"; # get the value of "Infected lines" MALWARE=$(tail "$LOGFILE"|grep Infected|cut -d" " -f3); # if the value is not equal to zero, send an email with the log file attached if [ "$MALWARE" -ne "0" ];then # using heirloom-mailx below echo "$EMAIL_MSG"|mail -a "$LOGFILE" -s "Malware Found" -r "$EMAIL_FROM" "$EMAIL_TO" -v .; fi done exit 0
_______________________________________________
Manage your clamav-users mailing list subscription / unsubscribe: https://lists.clamav.net/mailman/listinfo/clamav-users Help us build a comprehensive ClamAV guide: https://github.com/Cisco-Talos/clamav-documentation https://docs.clamav.net/#mailing-lists-and-chat