Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron Job Timout

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I know enough about Unix cron jobs to be dangeruos. Is there a way to add a timeout to a cron job?

Any guidance would be helpful.

Auguy
 
Sorry, forgot to include this SCO Open Server 5.0.5
 
Any chance you could explain what do you want to do ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I would like the cron job to stop processing after NNN seconds and kill itself. I was hoping for something as simplistic as issuing a TIMEOUT 120 in the script, but it's probably more complex than that.

Auguy
 
A starting point:
(sleep 120; kill -14 $$ >/dev/null 2>&1; echo "") &
# your stuff here ...
exec kill $! >/dev/null 2>&1


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, I don't understand all of that, but you indicated exactly where my code should go. I will try it out.

Auguy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top