When you open your .bashrc file, note this comment near the very top of the script:
Quote:# If not running interactively, don't do anything
Crontab jobs are non-interactive, and your .bashrc halts there - that's why you don't get your environment variables.
If you really insist on using CI_ENV for this (there's nothing wrong with changing a line or two in index.php), just put your exports above that comment line.