Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Cron Jobs That Run For Too Long

by shriken (Priest)
on Dec 20, 2005 at 20:45 UTC ( #518182=note: print w/ replies, xml ) Need Help??


in reply to Cron Jobs That Run For Too Long

...or put your two crontab entries on one line: Use unix shell boolean "and" to force the shell to run multiple commands one by one...

cd /foo/dir && ./runcmd_1.pl && cd /foo2/dir2 && ./runcmd_2.pl

or write simple shell script...

#!/bin/sh cd /foo/dir ./runcmd_1.pl cd /foo2/dir2 ./runcmd_2.pl
and schedule the shell script. I prefer the later because your crontab doesn't get messy and you can include mucho comments in the shell script


Comment on Re: Cron Jobs That Run For Too Long
Select or Download Code
Re^2: Cron Jobs That Run For Too Long
by wolfger (Deacon) on Dec 21, 2005 at 12:44 UTC
    ...or put your two crontab entries on one line: Use unix shell boolean "and" to force the shell to run multiple commands one by one...

    As I read the problem, this does not make any sense. My understanding is that this is not an issue of multiple commands, but rather a single command which is run frequently enough that it can sometimes overlap itself. Like, say, a cronjob run once per hour that occasionally take 70 minutes to complete, so that cron is trying to start a new instance before the old instance is finished (which can be quite nasty).

    My personal preference in cases like this is to put a routine at the beginning of the script to check running processes for another process of the same name.
    ...or to change cron to run the task infrequently enough that it doesn't overlap. :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-08-30 20:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls