Need to run this shell file in the background every 10 secs

Posted by mikey1090, 03-19-2007, 04:44 PM
The following shell script (a php loop to run a file) That is in a file named "myfile" placed in the root how can i run that in the background every 10 seconds, so when i close putty it still runs mike

Posted by Engelmacher, 03-19-2007, 04:57 PM
Why does it need to be a PHP file and why do you need to run it every 10 seconds if it loops on its own?

Posted by Barti1987, 03-19-2007, 05:06 PM
Put the command to run the file in crontab. I am not sure how the look of it will be, but I am thinking of something like this would run each minute (I don't think cron works in seconds, would probably would kill the server): Peace,

Posted by Russ Foster, 03-19-2007, 05:09 PM
You might want to look at something like nohup which will cause a program to still run if the session is closed

Posted by mikey1090, 03-19-2007, 05:33 PM
thanks, that helped

Posted by Extreme43, 03-19-2007, 08:06 PM
You might want to use the following during each loop

Posted by mikey1090, 03-20-2007, 06:08 AM
thanks i might use that. Will my loop keep stopping every 30 seconds otherwise?

Posted by sergeysg, 03-20-2007, 05:50 PM
It depends on your php.ini settings and yes, it is 30 seconds by default, but this DOESN'T affect usage of PHP in command line (CLI) mode. Quote from manual: BTW you can specify the path to php.ini file when you call php from command line using -c parameter - useful very often to have custom php.ini for PHP command line usage.

Was this answer helpful?

 Print this Article

Also Read

php/mysql q

Posted by Sammy89, 02-14-2011, 03:45 PMis there a better way to write: Posted by...

2 questions about setting up domain registration!!

Posted by 21inchguns, 09-13-2001, 09:41 AMHi there, I just have two questions regarding setting...

script that help to print on 2 printers?

Posted by bambinou, 10-30-2012, 06:21 AMHello, Do anyone of you know where to get a script...

Sprynex ?

Posted by zshelton, 09-04-2002, 12:27 AMDoes anyone here have any experience with Sprynex? good...

MySQL error code: 2006

Posted by Glostar, 04-18-2009, 03:54 AMI update MySQL from version 4 to 5.0.67-community. Now, I...