Jump to content


Photo

php "constantly running" question


  • Please log in to reply
3 replies to this topic

#1 makeshift_theory

makeshift_theory
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts

Posted 25 October 2006 - 04:57 PM

Sorry didn't know a better subject line first off....

Secondly here is the situation, I have written a php application that will watch different ports on my home server and display whether they are off or on, so I can check the status of my server at all times.  However I would like to implement some new functionality into this but I would like some opinions first.  The new functionality I would like to add is if a particular service goes down say Proftpd which is on port 21, I want it to send me an e-mail saying that service is down.  Now I know how to code all of that fine however I would for the script to "run on it's own."  The only two ways I can see doing this are to add a refresh on the page and keep it open at all times or create a shell script to open the page every so often.  I would like you guy's opinion on it before I attempt anything.  BTW I write on Linux so I can't do batch files, I use sh.
<b>Emacs</b> it's great for the body.
<br><br>
<b>Trust the TechnoLust</b>

<b><u>Have a question check here:</u></b>
PHP Manual: http://www.php.net

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 25 October 2006 - 05:05 PM

personally i'd just start a cron job to run every minute or so, depending on how often you want it to run.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 makeshift_theory

makeshift_theory
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts

Posted 25 October 2006 - 06:06 PM

That's pretty much the exact words my co-worker said, I suppose that's probably going to be the best option.  Thanks a bunch.
<b>Emacs</b> it's great for the body.
<br><br>
<b>Trust the TechnoLust</b>

<b><u>Have a question check here:</u></b>
PHP Manual: http://www.php.net

#4 SieRobin

SieRobin
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts
  • LocationNew Jersey

Posted 25 October 2006 - 06:12 PM

Cron jobs is your only other option, lol.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users