[Thamesvalley-pm] scripting question
fly at anydata.co.uk
Wed Aug 15 23:45:23 PDT 2007
Greg Matthews wrote:
> Not sure if this is the right place to ask as most of the traffic on
> this list seems to be about meeting, but here goes...
> I have a perl script (attached) which runs as a cron job. When I run it
> as root from the command line it produces a good report but when it is
> run from cron, the bitdefender statistics never get printed. Its as if
> the %bitdef and %bitdef_today hashes dont get populated.
> As far as I can see, the only difference between the bitdefender
> sections and the other hash sections is the regexp used. Can anyone
> explain why I get different results when running from cron rather than
> from the cli?
Are you capturing the stdout/stderr from the cron job? Any clues there?
One word of advice, always include the following two pragmas in your
scripts, they will save you a lot of trouble later:
BTW, the regexp in your script will not catch the Sophos example below,
because of the blank between the two W32/Netsky-P, typo in email copy?
> typical log lines for all three AV engines:
> Aug 14 07:36:43 relay1 MailScanner: SophosSAVI::INFECTED::
> W32/Netsky-P W32/Netsky-P:: ./l7E6aQsg007006/old_photos_mailer-daemon.zip
> Aug 14 07:36:43 relay1 MailScanner: ClamAVModule::INFECTED::
> Worm.SomeFool.P:: ./l7E6aQsg007006/old_photos_mailer-daemon.zip
> Aug 14 07:36:47 relay1 MailScanner:
> l7E6aQsg007006/old_photos_mailer-daemon.zip=>document.txt .exe:infected:
> Win32.Netsky.P at mm
More information about the Thamesvalley-pm