Process management


 
Thread Tools Search this Thread
# 1  
Error

Hi!

I desperately need some help here...
I need to write a shellscript that lists all running processes (as in ps -ef), search the list it gets for occurances of a certain process, if found do nothing if not found start it again.
Anyone feel up to it?

/G
# 2  
Try something like:

Code:
#!/bin/ksh

ps -ef | grep [f]oo
if [ $? -eq 1 ]
then
	echo Process not running.
	# Restart process here
fi


Replace 'foo' with whatever your process name is. The
[ ] brackets around the first letter will stop grep from matching on itself.

HTH
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

4 More Discussions You Might Find Interesting

1. What is on Your Mind?

Individual Risk Management (Personal IT Security) and Browser Cache Management

Original post from this thread on browser caching. To add to this, it is an effective security measure to clear absolutely all cached data (cookies, web content, ....) when closing the browser - i.e. in case of a shutdown. It takes a bit of work to re-login to all the sites but websites will not... (7 Replies)
Discussion started by: bakunin
7 Replies

2. HP-UX

Unix process management

Hi guys, I want to learn the process management in unix deeply. I have looked for different commands here and there but I can't find a consolidated document or book, does anybody have a link to any book or something? Regards, Messi (1 Reply)
Discussion started by: messi777
1 Replies

3. AIX

service/process management -autostart at startup

Hi, I want to modify some of the services/processes (related to the oracle database) to start automatically at the startup of the server. which commands may help me? which commands do I need to use? my server configuration is, in brief: hardware:IBM P550 / OS : AIX 5300 thanks,... (1 Reply)
Discussion started by: talipk
1 Replies

4. UNIX for Dummies Questions & Answers

"Process management" question

This one will show how "wet behind the ears" I am but here it goes... Suppose my boss wants me to run an app every day from the command line. The command line statement looks like this: $> my_executable_program -my_parameter file > my_outfile Let's say that one day, I do this: $>... (1 Reply)
Discussion started by: alan
1 Replies

Featured Tech Videos