Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Cron or running process?

by Ryszard (Priest)
on Apr 29, 2004 at 08:36 UTC ( #349048=note: print w/replies, xml ) Need Help??


in reply to Cron or running process?

As others have said 2 & 3 are similar.

I've done it both ways for various things, personally I like the ease of cron, but it has some disadvantages you should know as well:

  1. Cron can crash, if you're not aware of this, then your entire process will fail.
  2. cron can be tricky to work with as it doesnt source and environment, stuff that works interactively may not work with cron.

OTOH, if you're daemonising the process you can do some cool stuff like starting it via the init.d, you can see if it is explicitly alive by looking at the process table. The down side is it may die at any time for any reason, memory, a bug, whatever.

Bottom line, is you do what you're comfortable with, and add monitoring. You want to know if your process is alive, or your cron job has run, you want to be alerted if your job abends, or your daemon fails.

There are a couple of methods i use which seem to work quite well.. checking the last update of your log file, will implicitly tell you everything is ok. If possible you should monitor the functionality of your daemon/job, so you can explicitly tell if its run..

Replies are listed 'Best First'.
Re: Re: Cron or running process?
by freddo411 (Chaplain) on Apr 29, 2004 at 17:38 UTC
    ++ to the parent message.

    To this point, cron's default behavior is to email all output to the user whose crontab invoked the process. Often times, the crontab output is redirected somewhere else , /dev/null being a popular choice, or other useful log file.

    I tend to have my cron processes email success emails to one address, and failure to another address.

    Good sysadmin's hook their processes into their favorite monitoring tools, TMTOWTDI.

    --Fred

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://349048]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2021-04-14 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?