简体   繁体   中英

Cron jobs and cakephp not working

I'm new to cron jobs and stuff and I need a but of help.

So I created a shell, and I can run it manually from the cakephp console; however now when I try to set up a cron job it is not working. Simply nothing happens. Hopefully it is an easy fix and I am missing something obvious. This is what I have done so far:

I typed crontab -e, then at the end of the file typed this:

* * * * * cd /web/app && Console/cake schedule

Then saved it.

Any help is greatly appreciated, thanks :)

add cron_dispatcher.php as mentioned in Cron Dispatcher CakePHP 2.0

after that, create CronsController.php and create function cron in CronsController.php

Now, you can run cron from command prompt like below image (In image crons code is old you can use below commnad for new cakephp),

Run command like E:/wamp/bin/php/php5.3.8/php.exe E:/wamp/www/projectname/app/webroot/cron_dispatcher.php /crons/cron

Hurrey.. now your cron run..

Same you can run your cron on server by passing

[phppath of php] [rootpath]/app/webroot/cron_dispatcher.php /crons/cron

Cron说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM