I created a cronjob, it runs for a very long time but now don't know how to stop it. Please help.
migrated from stackoverflow.com Jan 17 '12 at 13:35
This question came from our site for professional and enthusiast programmers.
You should stop the process that the crontab started running.
To see a relation of the PID with the running processes (and more info) use
-HUP = Hang UP
|show 11 more comments|
I think if a shell-script wrapper is around that should timeout the cronjob, if it is running for a lengthy arbitrarily enough long periods of time. The wrapper should send the SIGHUP or SIGALARM when the timeout happens from the period the cronjob is invoked. Something like this:
This cron_wrapper_timeout should basically send the timeout signal once -t switch option 1 hour passes and then should send
Or alternatively, the code should be written with in the cronjob itself to handle the ALARM signal timeout and make sure it cleans up before it dies gently.
This is exactly what I was referring to: watchdog at http://chihungchan.blogspot.com/2011/03/no-more-hanging-jobs-in-cron.html