Page 1 of 1
Implementing scheduled task:HOW TO?
Posted: Mon May 12, 2008 5:08 am
by highjo
Hi! there.i'm trying to write a function that runs after a regular periode.For example the function should pull data like new suscribed clients from my database every 6 PM.the fact is i don't have idea about how to implement it.can anyone give me an idea?
I'm on windows and running XAMPP 1.6.5 thanks
Re: Implementing scheduled task:HOW TO?
Posted: Mon May 12, 2008 5:12 am
by aceconcepts
It sounds like a cron job would be the most fitting solution for this.
Take a look at
http://www.sitepoint.com/article/introducing-cron
Do you use cPanel? If so, cron jobs are very simple to setup from here.
Hope this helps

Re: Implementing scheduled task:HOW TO?
Posted: Mon May 12, 2008 7:46 am
by highjo
Ok! have the understanding.One more question.Since the cron job is done by Linux OS ,that means i can't try it with my XAMPP package locally.Most of the time we develop on windows and deploy on linux isn't there anything else to test and see its behaviour in terms of testing?thanks
Re: Implementing scheduled task:HOW TO?
Posted: Mon May 12, 2008 9:05 am
by aceconcepts
I'm not entirely sure about local testing - sorry

Re: Implementing scheduled task:HOW TO?
Posted: Fri May 16, 2008 6:25 am
by highjo
hello! i'm thinking about a new scenario where the task is limited a number of time.for example i'm sending a sms from the web sites and the actual sending is done through a http request.I'll need to check if the sms is delivered to the handset by another http request which i'm sending with the curl library let's say every 5 seconde and 5 times only.am i still in the case of linux cron job? can this be done in php ?and is there a better option to achieve this?please let me know.thanks
Re: Implementing scheduled task:HOW TO?
Posted: Fri May 16, 2008 11:10 am
by benyboi
I use a windows server and have a load of "cron jobs"/scheduled tasks running... what i do is use the built in "sceduled taks" thing in windows.
Just make a new task to run:
Code: Select all
C:\PHP5\php.exe -f D:\files\do.php
Where "C:\PHP5\php.exe" is the location of your php.exe file and "D:\files\do.php" is the file you want to run!
Hope that helps...
Re: Implementing scheduled task:HOW TO?
Posted: Fri May 16, 2008 12:48 pm
by highjo
thanks dude!i'll try that