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

Mysql not connecting....

Posted by mouseattack, 06-16-2006, 03:09 PMHere I was trying to change the password of the...

php/mysql q

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

Need Counter Help

Posted by paulg1981, 01-08-2008, 10:19 AMHello All, This is my first post in Programming so be...

Error handling in ASP.NET

Posted by Beach Musician, 09-08-2008, 11:49 AMI'm trying to help a colleague who wants to do...

How is this possible?

Posted by iUnknown, 09-16-2008, 02:27 PMHello, When I run the following command on my server:...