Welcome Guest, Not a member yet? Register   Sign In
Run a cron job on a controller method
#8

What you should probably doing is not using the 'sessions' by default, instead you should have your 'web' controllers extending a MY_Controller which has the session/authentication code, and then the CLI controllers just extend the vanilla CI_Controller.

I use a lot of controllers run as CLI scripts, the syntax in my crontab looks like e.g:

/usr/bin/php /full/path/to/index.php controller method

The above all works for me in 2.X. I'm migrating my code to 3.X at the moment but haven't got to the CLIs so apologies if the above is not entirely true for 3.x.
Reply


Messages In This Thread
Run a cron job on a controller method - by frobak - 05-25-2016, 06:01 AM
RE: Run a cron job on a controller method - by Andy N - 05-26-2016, 05:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB