问题
I would like to write a cron job that has to run a PHP script at 6am, 11am,2pm,4pm on each day.
Can you please help me with this? I wrote a shell task in shells and I want to run that task at the timings i said in the earlier statement.
Thanks.
回答1:
Link from CakePHP's book on this issue: http://book.cakephp.org/2.0/en/console-and-shells/cron-jobs.html
(older version of the docs): http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs
回答2:
you can set cron job like this in cakephp.
0 */4 * * * wget http://domainname.come/index.php/controllers/action.
来源:https://stackoverflow.com/questions/8004216/run-a-cron-job-in-cakephp