The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-27-2008
elDeuce elDeuce is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 4
Shell Script to Auto Run PHP Script

Hello All!

I am looking to build a monitoring script.

The script should always run as a system service of some type and should always check that a PHP script is running.

Maybe there is a way to assign a PHP script to a certain PID so that the monitor script that check for the PID in top and then if the PID does not exist, then have it run the PHP script.

Basically, I have built a PHP script the constantly monitors two sets of databases to verify that they remain the same and if one DB changes it writes it to the other.
There are MANY MANY reasons for it be done this way versus other possible ways. Mainly because of other functions this script does that due to lots of fun legal paperwork I can't disclose.

So, all in all...
Need a bash/shell script that will constantly check for my PHP script to make sure it is running and make it run if it doesn't exist.

I'm just tired of having a putty window open and my internet dieing and killing the script.

Any help or pointing in the right direction would be of tremendous help.
Thank you for your time!!!