[geeks] Killing process by name with cron.

Kurt Huhn geeks at sunhelp.org
Sun Jul 22 13:23:33 CDT 2001


Wow!

I wrote that exact script a few months ago to kill some runaways on our web
servers - poor application, nothing OS based or even controllable by us.  At
any rate, it's a bash script that calls PS with some flags, formats it and
parses with sed and awk, then executes commands on the return.

You don't mention your OS, but this script should be portable to most Unixes
with minor modifications.  I've loaded the script onto my website -
www.k-huhn.com/runaway.txt.  You'll need to change the search strings and
possibly the mail command to fit your needs.

Kurt



>
> Is there any script I can write that can kill the
> process by name? Something like ps -a | grep trplayer
> | kill bla bla bla?
>





More information about the geeks mailing list