Calling a controller via cron |
[eluser]GeXus[/eluser]
Does anyone know how to call a controller via cron? Since cron requires the path and everything in CI is routed through the index - if I were to call /public_html/system/application/controllers/controller.php that wouldn't work... Anyone know of workarounds? What needs to be run is pretty tied into CI, otherwise I would just do it outside of it...
[eluser]GeXus[/eluser]
Just wanted to update, I've set this up: http://jonathonhill.net/codeigniter/cron/ I've updated the CRON_CI_INDEX as instructed. I've added the following to cron via cPanel ***** /usr/local/lib/php -q /home/mydomain/public_html/cron.php --run=/reviews/do_update The path to php was taken from my include_path in phpinfo() (.:/usr/lib/php:/usr/local/lib/php) The path's are all correct. The script has been tested and is doing as expected when I run it from the browser. Any ideas? Thanks!
[eluser]GeXus[/eluser]
Ok got it working, php path was wrong... thanks for letting me talk outloud
[eluser]Rolly1971[/eluser]
thank you very much for talking out loud, gives me a solution for running cron on CI, and for my project cron jobs is a pretty important sales feature for my target audience. Cheers mate.
[eluser]GeXus[/eluser]
[quote author="Rolly1971" date="1281425369"]thank you very much for talking out loud, gives me a solution for running cron on CI, and for my project cron jobs is a pretty important sales feature for my target audience. Cheers mate.[/quote] Nice! |
Welcome Guest, Not a member yet? Register Sign In |