Computing.Net > Forums > Linux > Easy shell script question?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Easy shell script question?

Reply to Message Icon

Name: McHoffa
Date: April 14, 2003 at 05:41:20 Pacific
OS: debian 3.0
CPU/Ram: 1.3/256
Comment:

I asked this once but maybe my question was too
specific... I need to know how to write a script to
make sure a process is running every 5 minutes, if
it is, do nothing, and if it isn't to have it restart.

Thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: April 14, 2003 at 07:01:02 Pacific
Reply:

if [ `ps -ef | grep -v | grep -c process_name` -eq 0 ] ; then
/command/to/spawn/process &
fi


0

Response Number 2
Name: McHoffa
Date: April 14, 2003 at 07:36:10 Pacific
Reply:

Thank you very much


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Easy shell script question?

Shell Script Question www.computing.net/answers/linux/shell-script-question/15096.html

shell script help www.computing.net/answers/linux/shell-script-help/15420.html

launch program via shell script www.computing.net/answers/linux/launch-program-via-shell-script/14575.html