Since CodeIgniter does not accept arguments via the command line, you can not call a specific controller or function.
So you have to do the following to run CI from the CLI or Cron.
Create a second file in the root directory called cronjob.php or whatever and enter these two lines of code:
$_GET["/controller/function"] = null;
Make sure to replace “controller” and “function” with your desired controller/function.