I was delighted to learn that one can invoke CodeIgniter controller methods via CLI so I've constructed a variety of controller methods to handle jobs I want to run via cron. There's one big problem: cron doesn't read the CI_ENV that I added to my .bashrc file so I cannot set CI_ENV before my code starts executing.
I did find a workaround of sorts. Namely, you add the source ~/.bashrc command before each of my cronjobs:
Code:
* * * * * source ~/.bashrc; php /tmp/foo/foo.php
This is a complex project with perhaps a dozen cron jobs, so that's going to result in a LOT of extra junk in my crontab. Can someone suggest a better way?