• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a controller via cron

#1
[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...

#2
[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!

#3
[eluser]GeXus[/eluser]
Ok got it working, php path was wrong... thanks for letting me talk outloud Smile

#4
[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.

#5
[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! Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.