Run a cron job in cakephp

孤者浪人 提交于 2019-12-11 17:16:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!