Closed GuillaumeHullin closed 3 years ago
Solution:
function pfz_speedtest_cron_install($enable=true){
// Install Cron Job
$command = "/usr/local/bin/php " . __FILE__ . " speedtest_cron";
install_cron_job($command, $enable, $minute = "*/15", "*", "*", "*", "*", "root", true);
}
The last argument was the problem... it should be true in order to write the config.
For reference: https://github.com/pfsense/pfsense/blob/102a3c02996b7eaa5ea8329614a890658978abf6/src/etc/inc/services.inc#L3138
In 2.4 setting false it doesn't write config but adds the cron job anyway, just for not let survive it at reboot. Maybe in 2.5 the behavior has changed.
the problem I see is that it doesnt register the Cron... This function seems to not work (but I can add the cron manually successfully):
Originally posted by @GuillaumeHullin in https://github.com/rbicelli/pfsense-zabbix-template/issues/78#issuecomment-876654051