Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: assert - checking up on other scripts

by mojotoad (Monsignor)
on Jul 22, 2010 at 08:11 UTC ( #850793=note: print w/replies, xml ) Need Help??

in reply to assert - checking up on other scripts

The less you have to put into a crontab, the better. There's no reason to pass code fragments into a script via command line, much less an automated one.

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:

  1. detect
  2. select
  3. 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.


Replies are listed 'Best First'.
Re^2: assert - checking up on other scripts
by sflitman (Hermit) on Jul 22, 2010 at 19:10 UTC
    Thank you for your insights, that makes a lot of sense.
    (I have also wondered why deliver doesn't mean 'de-liver')

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://850793]
[erix]: Danewerk
[LanX]: I seem to remember that the danewall was build by the Frankish empire against the Danes
[erix]: 500 AD thru viking age
[erix]: that would make sense but wikipedia thinks otherwise
[LanX]: oh me was wrong ...
[erix]: but it always works both ways of course
[LanX]: Funny some weeks ago, I met people from the Cimbrian peninsula who didn't know it's called the Cimbrian peninsula ...
[LanX]: ... treid to make smalltalk and felt like Sheldon.
erix looks up Sheldon ...
[erix]: ah. well, that must feel nice, no? ;)

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-03-22 18:44 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (283 votes). Check out past polls.