diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index cc5a12e7ad6cc..2cb60e12d45c8 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -260,6 +260,10 @@ dol_syslog("cron_run_jobs.php::fetch Error ".$cronjob->error, LOG_ERR); exit(1); } + + $parameters = array('cronjob' => $cronjob, 'line' => $line); + $reshook = $hookmanager->executeHooks('beforeRunCronJob', $parameters, $object); + // Execute job $result = $cronjob->run_jobs($userlogin); if ($result < 0) { @@ -286,6 +290,9 @@ } echo "Job re-scheduled\n"; + + $parameters = array('cronjob' => $cronjob, 'line' => $line); + $reshook = $hookmanager->executeHooks('afterRunCronJob', $parameters, $object); } else { echo " - not qualified (datenextrunok=".($datenextrunok ?: 0).", datestartok=".($datestartok ?: 0).", dateendok=".($dateendok ?: 0).")\n";