[Orca-users] Stopping 'file did exist and is now gone' message(s).
Blair Zajac
blair at orcaware.com
Sat Nov 23 13:08:01 PST 2002
"isaac r." wrote:
>
> Dear Blair,
>
> Thanks for the direct pointer to a file where to
> change this.
>
> I've modified the 'if' one-liner condition.
>
> Here's the synopsis and the 'if' line to change.
>
> # ---------------------------------------
> # iz - making a modification to minimize warning
> emails
> # by checking if the hour on the clock is midnight,
> # which means the day has changed within the last
> hour.
> # If it did, then do not send the warning email and
> ignore the
> # fact that the file is gone (i.e. possibly
> compressed). Otherwise, send
> # an email.
> # ---------------------------------------
>
> Basically, assuming 'date' lives in '/bin' on
> your system, change:
>
> if ($file_status == -1) {
>
> to:
>
> if ($file_status == -1) && (`/bin/date
> '+%H'`!='00') {
>
> This should do it. It will also prevent OTHER types
> of alarms from being generated, reasons for which
> might be
> different then due to simply compressing the file.
> But this puts a 60 minute cap on a window within which
> some warning emails will not be generated.
>
> Thoughts ?
Thanks for the patch. I don't like to call out to external
programs in Orca, given that Perl already has access to all
the necessary information without forking a new process.
How about using the localtime call and rewriting the patch?
Also, the best way to submit patches is to do something like
this:
cd lib/Orca
cp -p SourceFile.pm SourceFile.pm.0
edit SourceFile.pm
diff -u SourceFile.pm.0 SourceFile.pm > ~/source-file-patch.txt
email ~/source-file-patch.txt to the list
Best,
Blair
--
Blair Zajac <blair at orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
More information about the Orca-users
mailing list