how to check if a process is running in a server from shell script.

I want to write a unix shell script that will check if a process (say debu) is running in the server or not. If no , then send a mail to the corresponding person to start the process???

debu,

did you try the search option of the forum ?

Very sure, there are many threads discussing the same in various colors.

Please use the search :slight_smile:

Hey,

YOu can check the process state table with grep on the name of the process you wished to check.

ps -ef | grep "debu" > maillist.txt

if [ -s maillist.txt ] ; then
echo "Process is Running :)"
else
cat maillist.txt | mailx -s "ALARM !!" abc@aol.com
fi

Hope this'll work for you.
Thanks
Varun :b: