Page 1 of 1
Continuous Script
Posted: Thu Aug 26, 2004 7:43 pm
by cooldude_i06
Hi, I'm new to the forums and SQL, but i have been able to setup a simple mysql database. I'm looking for a script that can run continuously in the background and perform some necessary calculations every few minutes. I know some php but im not sure if php can be executed non-stop, without having to go to a url. The database is on a web server and not my computer. Thanks in advance.
Posted: Thu Aug 26, 2004 7:51 pm
by markl999
Sounds like you want a
cron job
Posted: Thu Aug 26, 2004 8:12 pm
by cooldude_i06
markl999 wrote:Sounds like you want a
cron job
ok my webserver supports cron jobs, and i think the best way to accomplish my task would be to create a php script and have cron execute it ....right??
if this is true can u also help me with the command of executing a php script, thanks again.
Posted: Thu Aug 26, 2004 8:21 pm
by markl999
ok my webserver supports cron jobs, and i think the best way to accomplish my task would be to create a php script and have cron execute it ....right??
Right.
if this is true can u also help me with the command of executing a php script, thanks again.
2 ways really. Either run the script in cron like '/usr/bin/php -q thescript.php' or put #!/usr/bin/php at the top (before the <?php tag) of your script and run just thescript.php from cron.