Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hello fellow monks, I'm looking for a bit of advice on the relative merits of running a script via cron on some interval, or having a process running. This is the basic scenario:

I have a web-database/CMS system, where, right now 100% of the work is done by cgi's acting on a database. There are some functions I'd like to have happen independent of the web server, such as specific actions taken at specific time intervals (like, for example, sending an email when a record is about to expire, etc.). It seems in order to have these sorts of things happen, I have three options:

1) Each time a script is called by the web server, it checks to see whether or not any actions are pending, then does them.
2) I set up a script to be run by cron on specific intervals, that checks for pending actions, and completes them.
3) I have a running script that periodically checks for pending action

An important thing to know is that I can't imagine that people will have actions that will happen with any more frequency than once an hour. Option 1 is my least favorite, because it depends on use of the web cgi's - which is not at all predictable. I'm leaning toward using cron, but I can imagine some of the advantages of having a running process.

Ideas, or experiences? Thanks!

In reply to Cron or running process? by michellem

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?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2022-11-30 18:36 GMT
Find Nodes?
    Voting Booth?