|
-
Dec 9th, 2004, 07:33 PM
#1
Thread Starter
Ex-Super Mod'rater
Running a script every so often but not triggered by the user?
How would you go about running a script every 4 minutes say....I'm wanting my app to send a email out and if its not been dealt with within 10minutes (approx) I want another email to be sent, this should repeat untill it has been dealt with.So is there a way to have a script keep running? I suppose I could do this by having it make a page which uses Javascript to refresh the page every 4 minuts but I'd prefer it if I could do it without a computer needing to have a page open like that.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Dec 10th, 2004, 12:14 PM
#2
Re: Running a script every so often but not triggered by the user?
I know how to do this on Linux but not sure about Windows. In Linux a process called cron is responsible for schedualing jobs, you will need shell access from your web host then at the command prompt type:
In the editor window to run a script ever 4 minutes enter the following and save the file (it should say crontab installed after saving):
*/4 * * * * /path/to/php/script.php
Have a look here for a full explanation of the syntax of this file.
Make sure you enter the following line at the top of the script:
#!/path/to/php/cgi
Last edited by visualAd; Jul 6th, 2005 at 04:53 PM.
-
Dec 10th, 2004, 01:54 PM
#3
Thread Starter
Ex-Super Mod'rater
Re: Running a script every so often but not triggered by the user?
 Originally Posted by visualAd
I know how to do this on Linux but not sure about Windows. In Linux a process called cron is responsible for schedualing jobs, you will need shell access from your web host then at the command prompt type:
In the editor window to run a script ever 4 minutes enter the following and save the file (it should say crontab installed after saving):
*/4 * * * * /path/to/php/script.php
Have a look here for a full explanation of the syntax of this file.
Make sure you enter the following line at the top of the script:
#!/path/to/php/cgi -f
Thanx, yea my server lets me run CronTabs, has a little control panel for it but I guess I'll be able to figure out how it works .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|