Menú
08225, Terrassa (Barcelona)
Soporte Técnico
Sábados a convenir
Cita de admin en 26 julio, 2019, 12:25 pmscript onacces scan
#!/bin/sh
tail -fn0 /var/log/clamav/clamav.log | \
while read line ; do
echo "$line" | grep -oP "ScanOnAccess: \K(.*)(?=:(.*) FOUND)"
if [ $? = 0 ]
then
virusfile=$(echo "$line" | grep -oP "ScanOnAccess: \K(.*)(?=:(.*) FOUND)" | grep -oP "(.*)(?=:(.*))")
if [ -n "$virusfile" ]
then
echo "Found and quarantined virus file: $virusfile" >> /var/log/clamav/clamav-cleaner.log
mv $virusfile /path/to/quarantine/
fi
fi
done
script onacces scan
#!/bin/sh
tail -fn0 /var/log/clamav/clamav.log | \
while read line ; do
echo "$line" | grep -oP "ScanOnAccess: \K(.*)(?=:(.*) FOUND)"
if [ $? = 0 ]
then
virusfile=$(echo "$line" | grep -oP "ScanOnAccess: \K(.*)(?=:(.*) FOUND)" | grep -oP "(.*)(?=:(.*))")
if [ -n "$virusfile" ]
then
echo "Found and quarantined virus file: $virusfile" >> /var/log/clamav/clamav-cleaner.log
mv $virusfile /path/to/quarantine/
fi
fi
done
© Informàtica Can Boada All rights reserved