Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I also wish it was a Linux machine so I can use cron

FYI, Windows does have a chron "equivalent". It is called Task Scheduler. It has both a Windows and a command line interface. Something like "run program X every 30 minutes" is possible. I've used Task Scheduler to periodically run a Perl script before without problems.

Update with a few comments and considerations: I wouldn't necessarily interpret the user request for "one program" as a hard and fast design implementation limitation. It appears that the main point appears to be something reliable. Simple often, but not always yields reliable.

For the "wait for emergency" function, you could have a simple loop that does blocking I/O on that port while waiting for the "Emergency" message. If you get messages fairly regularly that are not "emergencies", blocking I/O would fine fine.

For the once per 30 minute "watchdog on the monitor for emergency" function. In applications that I've worked on, more than the "process is running" is often required. The thing to be verified is: "is the thing that is monitoring for an emergency" really doing actual work(processing messages looking for an emergency)? You could have the main monitoring function do something that is observable by the "watchdog" process. Perhaps simply incrementing the name of a zero length file for every message it looks at? If the watchdog function determines that no messages are being processed by the monitoring function, it would conclude that something is amiss in addition to making sure that the monitor process is actually "running", i.e. in the process table.


In reply to Re^3: Timed event within a script by Marshall
in thread Timed event within a script by bajangerry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found