Calling a controller via cron - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Calling a controller via cron (/showthread.php?tid=32928) |
Calling a controller via cron - El Forum - 08-09-2010 [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... Calling a controller via cron - El Forum - 08-09-2010 [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! Calling a controller via cron - El Forum - 08-09-2010 [eluser]GeXus[/eluser] Ok got it working, php path was wrong... thanks for letting me talk outloud Calling a controller via cron - El Forum - 08-09-2010 [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. Calling a controller via cron - El Forum - 08-09-2010 [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! |