I do it this way, create a cron folder
/application /cron my_task.php /public
make a script for each cron / cron / my_task.php job with the contents
<? $_SERVER["SCRIPT_URL"] = "/controllerName/MethodName"; // you can set url in routes if you want $_SERVER["HTTP_HOST"] = "your_site_address.com"; // without http://www require(dirname(__FILE__) . "/../public/index.php"); // path to index.php ?>
make the cron controller look like the others, but add an IP check to __construct
and final launch for example
1 10 * * * cd /path_to_site_folder/cron/ && usr/local/bin/php /path_to_site_folder/cron/my_task.php >> path_to_log/some.log
san4o
source share