|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
timeout for cron job - pls help!
Hi,
i have two cron jobs, one running after another ends. If the first cron job keeps executing, and gets hang, i will like to have a timeout for the cron job, so that the next cron job can run. How can I do it? |
|
#2
|
||||
|
||||
|
why not just separate them by several hours? Set the first one at 2am and the second at 5am. Or swap them around? Or do they both hang? What OS are you using and what shell?
|
|
#3
|
|||
|
|||
|
something similar to this could work (untested):
Code:
program & echo "kill $?" | at now+1h It *could* kill the wrong process though. If the program has quit by itself till then, the PID that comes from $? will not be valid anymore. But itīs unlikely that your PIDs wrap over within an hour. You could also use a "lock file" for the first process and have the second process check if #1 is still running and if so, kill it.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > timeout for cron job - pls help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|