Title sums it up, I know little about how I will do this.
See also:
Have you ever looked at ATrigger? A PHP library is also available to create scheduled tasks without overhead.
Disclaimer: I'm among their team.
The best method for scheduled tasks is beanstalkd with delayed put.
Use your operating system's scheduled tasks facility. crontab on unix, scheduled tasks on windows.
Then we have some more considerations:
- Do you want to schedule tasks through a PHP script that adds stuff to the main OS way to schedule tasks? or
- Do you want to have a long running php process that will run things at determined times?
For 1, on Unix, you can use something like this module that will do.
For 2, you can use something like this other module.
The easiest way I know is a simple cron job.
****PHPCron: Running scheduled tasks from PHP on a web server****
But PHPCron is temporarily not available from there. You might need to look somewhere else
One method is to use: http://phpjobscheduler.co.uk/ it will allow you to add/run lots of php scripts, easily manage them and "out of the box" for FREE, its open source.
Best method, not sure, I will leave it upto others to pass judgement.
来源:https://stackoverflow.com/questions/190561/what-is-the-best-method-for-scheduled-tasks-in-php