I need a script to identify runaway processes by a user. I started by using the ps -u username. I am using grep and awk. I can display the processes but I can not kill the process. Any ideas?
Smitty,
I would be afraid to let a script determine what a runaway process is but I do have a script to kill a process by name
#Script which will kill all processes with a given name
#
clear
echo "\n\n"
echo "Please, enter the name of the process you want to kill. \c";
read PROC_NAME
#
PID=`ps -ef | sort +6| grep $PROC_NAME|grep -v grep |awk '{print $2}'`
if [ "$PID" ]
then
`kill -9 $PID`
else
echo "I couldn't find that process name."
fi
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.