[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [HS] scripts utilisant clamav



Le Tuesday 18 November 2008 vers 19:37, giggz(giggz 
<giggzounet@gmail.com>) a écrit:
> Bonsoir,

Bonsoir,


> clamdscan="/usr/bin/clamdscan"
>
> [ -x $clamdscan ] || exit 0
>
> # See ionice(1)
> if [ -x /usr/bin/ionice ] &&
>     /usr/bin/ionice -c3 true 2>/dev/null; then
>     IONICE="/usr/bin/ionice -c3"
> fi

----
#Fichier d'état pour déterminer les fichiers modifiés, crées
STATEFILE=/home/giggz/.lastscannedtimestamp


if [ ! -f "$STATEFILE" ] ; then
	touch -t -t 190201010000  $STATEFILE #création du fichier d'état 
avec en date de 01/01/1902
fi

touch /tmp/.statefileForNextScan
sync
sleep 10

find /home/giggz/ -type f -newer $STATEFILE | xargs -l1 $IONICE 
$clamdscan --no-summary  --stdout | grep  ' FOUND$' 

# Mise à jour fichier pour le prochain scan
touch -r /tmp/.statefileForNextScan $STATEFILE
rm -f /tmp/.statefileForNextScan
--------------

*Normalement*, ce script ne scanera que fichiers modifiés/crées 
depuis le scan précédent!

A+

-- 
http://www.glennie.fr
The reasonable man adapts himself to the world; the unreasonable one 
persists in trying to adapt the world to himself. Therefore all 
progress depends on the unreasonable man.


Reply to: