
paaaaede
Jungspund
hallo zusammen
ich habe ein script gemacht welches den uvscan (on demande anti virus scanner) von mcafee mit einigen optionen anwirft, danach wird der returncode überprüft ist der returncode = 0 macht das script einen eintrat in einem file kein virus gefunden, findet der uvscan jedoch einen virus ist sein returncode != 0 und ich versende ein mail
folgende return codes kennt der antivirus:
0 The scanner found no viruses and returned no errors.
2 Integrity check on a DAT file failed.
6 A general problem occurred.
8 The scanner could not find a DAT file.
12 The scanner tried to clean a file, and that attempt failed for some reason,
and the file is still infected.
13 The scanner found one or more viruses or hostile objects — such as a
Trojan-horse program, joke program, or test file.
15 The scanner’s self-check failed; it may be infected or damaged.
19 The scanner succeeded in cleaning all infected files.
102 The scanner quit because the --exit-on-error option. was included.
kopiere ich den eicar.com testvirus in das verzeichnis in dem ich scanne bekomme ich ein return code 13 und ein mail wird verschickt und alles läuftg wunderbar, jedoch NUR solange ich dieses script von hand per root starte führe ich dieses script mittels cron aus bekomme ich einen returncode 127
mein crontab eintrag: (in der testphase mache ich das jede minute)
* * * * * root /usr/local/uvscan/avscan.sh
an was könnte das liegen dass das script per cron eine andere ausgabe macht und mir auch mails schickt, wenn es keinen virus hat (weil der returncode nicht = 0 ist)
hier noch mein scan script
-----------------------avscan.sh---------------
echo "Virus auf moveI gefunden!" > /usr/local/uvscan/log/temp.txt
echo "Date:" >> /usr/local/uvscan/log/temp.txt
date >> /usr/local/uvscan/log/temp.txt
echo "" >> /usr/local/uvscan/log/temp.txt
echo " ------------------------" >> /usr/local/uvscan/log/temp.txt
echo "" >> /usr/local/uvscan/log/temp.txt
uvscan --move /infected -r --secure --one-file-system --unzip /home --summary 2>&1 >> /usr/local/uvscan/log/temp.txt
ERRORCODE=$? # errorcode von uvscan
if [ $ERRORCODE -eq 0 ] # errorcode
then
echo "---------------Kein Virus gefunden" >> /usr/local/uvscan/log/scan.log
date >> /usr/local/uvscan/log/scan.log
else echo "-V-I-R-U-S----- Virus oder Error! $ERRORCODE" >> /usr/local/uvscan/log/scan.log
date >> /usr/local/uvscan/log/scan.log
mail -s "VIRUS@moveI" ********** < /usr/local/uvscan/log/temp.txt
fi
---------------------------------------------
ich habe ein script gemacht welches den uvscan (on demande anti virus scanner) von mcafee mit einigen optionen anwirft, danach wird der returncode überprüft ist der returncode = 0 macht das script einen eintrat in einem file kein virus gefunden, findet der uvscan jedoch einen virus ist sein returncode != 0 und ich versende ein mail
folgende return codes kennt der antivirus:
0 The scanner found no viruses and returned no errors.
2 Integrity check on a DAT file failed.
6 A general problem occurred.
8 The scanner could not find a DAT file.
12 The scanner tried to clean a file, and that attempt failed for some reason,
and the file is still infected.
13 The scanner found one or more viruses or hostile objects — such as a
Trojan-horse program, joke program, or test file.
15 The scanner’s self-check failed; it may be infected or damaged.
19 The scanner succeeded in cleaning all infected files.
102 The scanner quit because the --exit-on-error option. was included.
kopiere ich den eicar.com testvirus in das verzeichnis in dem ich scanne bekomme ich ein return code 13 und ein mail wird verschickt und alles läuftg wunderbar, jedoch NUR solange ich dieses script von hand per root starte führe ich dieses script mittels cron aus bekomme ich einen returncode 127
mein crontab eintrag: (in der testphase mache ich das jede minute)
* * * * * root /usr/local/uvscan/avscan.sh
an was könnte das liegen dass das script per cron eine andere ausgabe macht und mir auch mails schickt, wenn es keinen virus hat (weil der returncode nicht = 0 ist)
hier noch mein scan script
-----------------------avscan.sh---------------
echo "Virus auf moveI gefunden!" > /usr/local/uvscan/log/temp.txt
echo "Date:" >> /usr/local/uvscan/log/temp.txt
date >> /usr/local/uvscan/log/temp.txt
echo "" >> /usr/local/uvscan/log/temp.txt
echo " ------------------------" >> /usr/local/uvscan/log/temp.txt
echo "" >> /usr/local/uvscan/log/temp.txt
uvscan --move /infected -r --secure --one-file-system --unzip /home --summary 2>&1 >> /usr/local/uvscan/log/temp.txt
ERRORCODE=$? # errorcode von uvscan
if [ $ERRORCODE -eq 0 ] # errorcode
then
echo "---------------Kein Virus gefunden" >> /usr/local/uvscan/log/scan.log
date >> /usr/local/uvscan/log/scan.log
else echo "-V-I-R-U-S----- Virus oder Error! $ERRORCODE" >> /usr/local/uvscan/log/scan.log
date >> /usr/local/uvscan/log/scan.log
mail -s "VIRUS@moveI" ********** < /usr/local/uvscan/log/temp.txt
fi
---------------------------------------------