Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Cron Jobs That Run For Too Long

by shriken (Priest)
on Dec 20, 2005 at 20:45 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://518182]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2024-04-25 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found