Guest MDMAchine Posted April 16, 2005 Report Share Posted April 16, 2005 (edited) Hello all, I guess this thread here would best suit what I need to ask, and I have tried to search but didn’t see anything about this. Anyways... I run a process which is for statistical generation. Anywhere from 2-12 hours the process remains but stops working. I don’t think it has to do with high CPU load or anything like that. I believe it has a bug, so it’s running, but not working right anymore. Now I had made a cron job set for every 1 hour in hopes that it would "restart" the process, but I guess if it’s running it does not kill it. The cron job is as follows: 0 * * * * cd /command/directory; ./pearlscript.pl So now if I go in and kill this process by hand when it starts up again it has a new PID. So I can’t set a cron to kill this PID every 58 mins to then get restarted... Or can I? I would need "static" information to have it set like that I would assume? Any help on this situation would be appreciated! Remembering to kill this process every 2 hours is annoying. BTW - These forums are great I have used them for resources for over a year, and until now has answered all of my questions! Sorry if there is something about this that I missed.... MD Edited April 17, 2005 by MDMAchine Quote Link to comment Share on other sites More sharing options...
adamw Posted April 17, 2005 Report Share Posted April 17, 2005 you could get it to write its pid out to a file when it started and kill that, or you could be lazy. I'm assuming it always has the same process name and that name is unique. If so, you can just use killall: killall foo kills all processes named foo, no matter what their PID. Quote Link to comment Share on other sites More sharing options...
Guest MDMAchine Posted April 17, 2005 Report Share Posted April 17, 2005 Thanks man! Worked for me! Out of everything I looked up killall wasnt one of em. MD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.