Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How run zend framework action (inside index controller) by cron every 12 hours?

How run zend framework action (inside index controller) by cron every 12 hours?

The case:

  1. I have basic(no modules) zend project (1.11) that created by zf tool.

  2. Inside main IndexController exist cronAction() - url http://mydomain/index/cron.

  3. Need to run cronAction() once per 12 hours by cron.

Thanks

like image 779
Ben Avatar asked Jun 29 '11 11:06

Ben


1 Answers

Find the crontab file and add this line:

0 0,12 * * * curl --silent --compressed http://mydomain/index/cron

You can also do it with other tools, such as lynx or wget, not necassarily curl - the above is just an example.

like image 105
mingos Avatar answered Sep 30 '22 17:09

mingos