Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup cronjobs in cake php?

Tags:

cakephp

How can I use cron job in cakephp to call an action of a controller on Ubuntu, I am trying to do it through crontab but it is not working?

like image 706
php geek Avatar asked Dec 19 '12 09:12

php geek


1 Answers

Use a shell

The 'Cake Way' of using a CakePHP application in cron jobs would be creating shell and then calling it as a cron job.

i.e. Create a shell to do the task, and then add it to crontab (crontab -e on linux machine):

0 * * * *       cd /path/to/app/ && Console/cake your_shell_name params

Creating shells and using them with cron is covered in the documentation.

like image 155
icebreaker Avatar answered Sep 24 '22 06:09

icebreaker