Author Topic: How do I create a script that will restart another script after so many minutes?  (Read 9004 times)

0 Members and 1 Guest are viewing this topic.

Offline helen

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • KISSY KISSY KISSY LICKY LICKY LICKY
    • View Profile
I think he already has an auto-restart script. I'm not sure though, we'd have to ask him.
Oh, and btw helen, this script will also start Omnom on its own if it isn't running. You can start it first or just my script, it doesn't really matter.

Yes I'm aware of that. :3

You could do the pid thing. You could also run the script itself ( ./OmnomIRC.php ( make sure to add the right stuff to the start of it ( #!/usr/bin/php5 ) ) ) that way the process name will be the name of the script instead of php :)

EDIT: @ DJ: my script probably wont fix the issues where omnom stops relaying to one of the channels. That is a code issue I think. Unless he has multiple processes ( one per server he connects to ).
So if I had #!/usr/bin/php5 to the beginning of the script then what will the name of the script be?

EDIT (Eeems): merged posts
« Last Edit: February 10, 2012, 12:41:12 pm by Eeems »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
it would be OmnomIRC.php
/e

Offline helen

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • KISSY KISSY KISSY LICKY LICKY LICKY
    • View Profile
it would be OmnomIRC.php
How long does it take for the script to do a restart?

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
At most 3 seconds. It could be instant. If the script uses too much cpu power just increase the time for the sleep.
/e