EllisLab/CodeIgniter — Issue #984: CLI interface not functioning under cron
Author: AndreiBarsan
Created: 2012-01-26 21:12:07+00:00
State: open

Hello, I am using CodeIgniter for a rather large commercial application, and I need to run an hourly cron to manage sending some mail. Pretty basic. I was using the bootstrapper posted on the wiki - http://codeigniter.com/wiki/Cron_job_bootstrapper, with the following cron command:

/home/xxx/cron/cronBS.php --run=/admin/cron

Worked like a charm. Now, I updated to the latest version of CodeIgniter, 2.1.0 and while browsing the documentation, I noticed that the bootstrap script was useless since it seemed to work easier, http://codeigniter.com/user_guide/general/cli.html by just calling

php /home/xxx/www/index.php admin cron

However, this does not work. When printing the output in my email, it just shows the HTML of the landing page, with no error message being displayed. I know it's not some sort of botched session code, since switching back to the old version works great and the proper log files are created by the script.

What's strange is that running this via the CLI through SSH *works*, and if I remove the security functionality, so does simply accessing site.com/admin/cron, which is strange.

I cannot put my finger on it - could it be a true CI bug, or a problem with crond?