in reply to assert - checking up on other scripts
You're on the right track, however, by generalizing the problem and anticipating future uses for your notification script.
The larger problem you're confronting is three things:
- detect
- select
- deliver
Once you have removed the liver from your selected recipients, your task is complete.
Seriously, though. Break the tasks down and, if not put them into their own modules, at least put them into their own subroutines.
For example, rather than passing code fragments into your script via command line, use a hash for dispatching to the correct test routine; that way you can pass a parameter called "day_stale" and not worry about the quarantine and sanitization of arbitrary code.
Finally, why not consider the unix way of things? If find -ctime 1 myfilename comes up empty, your file has been dead for a day.
Cheers,
Matt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: assert - checking up on other scripts
by sflitman (Hermit) on Jul 22, 2010 at 19:10 UTC |