Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
978 views
in Technique[技术] by (71.8m points)

cakephp - How to setup cronjobs in cake php?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...