Re: [HS] scripts utilisant clamav
Glennie Vignarajah a écrit :
> 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+
>
Super merci!
je teste ça!
Guillaume
Reply to: