[PHP] automatic job execution
I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] automatic job execution
Depends on what system you are running, let us know and we can better answer the question. On Thu, 25 Jul 2002, Paul O'Neil wrote: I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] automatic job execution
On second thought, do you just want the script to run and sleep or actually schedule it as a job? You could just use sleep(). set_time_out(0); while ($i = 0){ your code sleep(60); } We use this at my company for a file parsing program, it runs, sleeps 15 minutes and repeats. -Scott On Thu, 25 Jul 2002, Paul O'Neil wrote: I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] automatic job execution
I looked at some old posts and I found #!/usr/local/bin/php -q should be included at the top of the script but I don't think I have permission on the system I'm on. -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 6:25 AM To: Paul O'Neil Cc: [EMAIL PROTECTED] Subject: Re: [PHP] automatic job execution On second thought, do you just want the script to run and sleep or actually schedule it as a job? You could just use sleep(). set_time_out(0); while ($i = 0){ your code sleep(60); } We use this at my company for a file parsing program, it runs, sleeps 15 minutes and repeats. -Scott On Thu, 25 Jul 2002, Paul O'Neil wrote: I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] automatic job execution
awe shit, that did work. thanks! -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 6:25 AM To: Paul O'Neil Cc: [EMAIL PROTECTED] Subject: Re: [PHP] automatic job execution On second thought, do you just want the script to run and sleep or actually schedule it as a job? You could just use sleep(). set_time_out(0); while ($i = 0){ your code sleep(60); } We use this at my company for a file parsing program, it runs, sleeps 15 minutes and repeats. -Scott On Thu, 25 Jul 2002, Paul O'Neil wrote: I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] automatic job execution
In order to run the script from the command line you need the cgi or executable version of PHP. You can have both on the machine, Apache uses mod_php and you use the cgi version for your scripts on the machine. On Thu, 25 Jul 2002, Negrea Mihai wrote: and what happens if you restart apache... ? On Thursday 25 July 2002 04:25 pm, Scott wrote: On second thought, do you just want the script to run and sleep or actually schedule it as a job? You could just use sleep(). set_time_out(0); while ($i = 0){ your code sleep(60); } We use this at my company for a file parsing program, it runs, sleeps 15 minutes and repeats. -Scott On Thu, 25 Jul 2002, Paul O'Neil wrote: I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] automatic job execution
You can do that or just run the command: /usr/local/bin/php -q name_of_script.php If you want to call the script directly by name instead of calling php like that you will need to make to executable and add the # line at the top. On Thu, 25 Jul 2002, Paul O'Neil wrote: I looked at some old posts and I found #!/usr/local/bin/php -q should be included at the top of the script but I don't think I have permission on the system I'm on. -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 6:25 AM To: Paul O'Neil Cc: [EMAIL PROTECTED] Subject: Re: [PHP] automatic job execution On second thought, do you just want the script to run and sleep or actually schedule it as a job? You could just use sleep(). set_time_out(0); while ($i = 0){ your code sleep(60); } We use this at my company for a file parsing program, it runs, sleeps 15 minutes and repeats. -Scott On Thu, 25 Jul 2002, Paul O'Neil wrote: I have a php script I would like run like a cron job every so many minutes. How is this done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php