1
votes

I am new to CakePHP. Please help me on how to write the command for the CronShell inside CronJob. i referred this also http://book.cakephp.org/2.0/en/console-and-shells/cron-jobs.html but still havn't got any success. Some of the examples i tried -

/home/evand/public_html/site_name/lib/Cake/Console/cake -app "/home/evand/public_html/site_name/app" CronJob test

/home/evand/public_html/site_name/lib/Cake/Console/cake CronJob test -cli /usr/bin -console /cakes/2.x.x/lib/Cake/Console -app /home/evand/public_html/site_name/app

Please tell where i am going wrong or what else command i need to write?

2

2 Answers

2
votes

It's much simpler

Those docs appear to be incorrect/outdated. To run a cronjob with cakephp ordinarily all that's required is the following:

 * * * * * cd /abs/path/to/app && Console/cake shell_name function_to_run

I.e. it's exactly the same as the normal way to run a console command.

0
votes

Here is how I run it.

* * * * * /var/www/app/app/Console/cakeshell shell_name function_to_run -cli /usr/bin -console /var/www/app/lib/Cake/Console -app /var/www/app/app >> /tmp/logile.log