currently I am using command to execute cron is
cd appfolder. ../cake/console/cake cronname
it is working on local linux server but,
(1) /home/chpltv/public_html/cron/cron/cake/console/cake -app "/home/chpltv/public_html/cron/cron/app" news_import_basic >> /home/chpl开发者_运维技巧tv/public_html/cron/a.txt
(2) sh ../home/chpltv/boxyourtvtrial.com/cake/console/cake.php -app "/home/chpltv/boxyourtvtrial.com/public_html/cron/cron/app/" news_import_basic >> /home/chpltv/public_html/cron/a.txt
it is not working.
I dont know wht is issue......
Please Help me
please tell me command to run cron in cake php
A shell is run from the app/vendors/shells directory within the application you have created. When you create the shell, if must also follow the same class structure as the other class based code in cake:
class ThisNewNameShell extends Shell {
// functions here
}
Then this shell is called run with the following command:
/path/to/cake/console/cake {name_of_shell} {name_of_function} {args} -app /path/to/app
If you still are not getting the desired results, turn on debugging and run the shell manually to see the output and fix any issues. Once they are resolved, you will have a working cron.
Happy Coding!
Without any error messages, it's hard to diagnose a problem.
Check your email or cron logs (possibly /var/log/cron) for error messages, they may help.
Check the permissions on your files to ensure the cron user can run the cake console etc.
Assuming you have php cli working fine (should be ok if you can run it manually on the same server), is it in the path when the cron executes?
Consider appending 2>/tmp/news_import_basic.err to the cron commands to capture any error messages to a log file.
精彩评论