diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 1d95a745e1c..630ae8c9948 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -92,7 +92,7 @@ $hookmanager->initHooks(array('cli')); $now = dol_now(); @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=".$userlogin." ***** ".dol_print_date($now, 'dayhourrfc')." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." - userlogin=".$userlogin." - ".dol_print_date($now, 'dayhourrfc')." *****\n"; // Check module cron is activated if (empty($conf->cron->enabled)) { @@ -250,7 +250,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { } //If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database - if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) { + if ($forcequalified || (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now))) { echo " - qualified"; dol_syslog("cron_run_jobs.php line->datenextrun:".dol_print_date($line->datenextrun, 'dayhourrfc')." line->datestart:".dol_print_date($line->datestart, 'dayhourrfc')." line->dateend:".dol_print_date($line->dateend, 'dayhourrfc')." now:".dol_print_date($now, 'dayhourrfc')); @@ -325,4 +325,6 @@ function usage($path, $script_file) print "30 3 * * * ".$path.$script_file." securitykey userlogin > ".DOL_DATA_ROOT."/".$script_file.".log\n"; print "For example, to run pending tasks every 5mn, you can add this line:\n"; print "*/5 * * * * ".$path.$script_file." securitykey userlogin > ".DOL_DATA_ROOT."/".$script_file.".log\n"; + print "\n"; + print "The option --force allow to bypass the check on date of execution so job will be executed even if date is not yet reached.\n"; }