killing a hung up process with a script
Ok here is my situation, In our shipping warehouse I have a print server running CUPS. Every once in awhile ghostscript get hung up and it puts a halt to everything until we can kill gs and restart cupsd. My boss wants me to make a script that will check everyfew minutes to see if gs is hung up or not and if so kill it and restart cupsd. now I know how to kill it without using a pid through my script from searching the forums but how can i get it to check how long, let's say i want it to kill it if it has been running for more than 3 minutes. any ideas?
|
nevermind i figured it out
|
care to share your solution?
I'd love to see it...
I assume it started out as something similiar to this: ps aux|grep user|grep pattern|awk '{print $2}'|xargs kill -9 |
All times are GMT -5. The time now is 06:35 PM. |