Major update: renamed from CLI Job Runner to Job & Cron Monitor - this tool no longer runs your jobs andhg:run-jobsis deprecated, use the corexf:run-jobsinstead. This addon is now for watching job & cron tasks and diagnosing issues.
Updates included in the 3.1.1 release:
3.1.1 (2026-10-12)
- declares to the Admin API add-on, on a forum that has it, that this add-on has no secret settings. It answers the
hampel_admin_api_redactioncode event, which is never fired on a forum without that add-on
3.1.0 (2026-10-08)
job-monitor:health-checkis nowjob-monitor:validate, and its exit codes have changed. It exits1if any check found a problem and0otherwise, warnings included, so a deploy or a cron job can depend on it. It used to exit1on a warning and2on a problem. The old name now checks nothing and exits1, so anything still calling it fails loudly- new:
--strictmakes a warning exit2, for a monitor that should hear of one.1still means a problem - this is not the monitoring-plugin numbering- a check that did not apply is shown with a blank marker and not as
OK: failed jobs on XenForo 2.2, which does not record them, and the cron job on a forum with no active cron tasks.--jsonreports these asskipped, and gains astrictkey- activity based job triggering is now a warning, since jobs then wait for page views and do not run from cron
- a check that cannot run is reported as a problem with the reason, and the other checks still report. It used to end the run
- server error log entries written by the add-on begin
JobRunner:- on XenForo 2.2, upgrading removes the files earlier versions left behind, which that version of XenForo never deletes
3.0.1 (2026-09-29)
- the
job-monitor:commands are listed without their oldhg:names beside them.hg:show-jobs,hg:show-crons,hg:run-cronandhg:test-jobsstill work in 3.x, but no longer appear inlist
3.0.0 (2026-09-29)
Renamed from CLI Job Runner to Job & Cron Monitor. The add-on no longer runs your jobs:
XenForo's ownxf:run-jobsdoes, and this add-on is for watching and diagnosing it. See
"Upgrading from 2.x" in the README.
- change your crontab from
hg:run-jobstoxf:run-jobs.hg:run-jobsstill works - it now runsxf:run-jobswith the same options and prints nothing of its own - but will be removed in a later major version.--resetis accepted and ignored- commands renamed:
job-monitor:run-jobs,job-monitor:show-jobs,job-monitor:show-crons,job-monitor:run-cronandjob-monitor:queue-test-job. The oldhg:names still work in 3.xjob-monitor:run-jobslogs each job and cron task without-v;--max-execution-time=0runs until the queue is empty- new:
job-monitor:health-checkchecks that jobs and cron are running - the cron job queued, overdue jobs and cron tasks, failed jobs, and an old crontab still callinghg:run-jobs. Exits 0, 1 or 2;--fixre-queues a missing cron job;--jsonfor monitoring- new: on XenForo 2.3 every failed job is recorded, not only in debug mode, and
job-monitor:show-failed-jobslists them- new: every job and cron task run is timed and kept hour by hour for 90 days;
job-monitor:show-statsshows the busiest, slowest or one task's history- new: a daily cron task prunes failed jobs after 30 days and statistics after 90
- XenForo's own
xf:run-jobsnow runs cron tasks with the add-on installed - the add-on used to hold them back for its own runner- the lock is gone: XenForo already stops two runners running the same job. The old lock file is deleted on upgrade
- on XenForo 2.2, a cron task throwing an
Errornow ends that run, as it does in XenForo itself; the other due tasks run on the next pass
2.1.4 (2026-09-29)
- bugfix: under server-based job triggering, the admin control panel no longer reports "There are scheduled jobs outstanding which have not run" when jobs are running normally. The add-on had stopped XenForo recording when the next job was due, so the check read a time that never moved
2.1.3 (2026-09-29)
- now requires PHP 7.1 or later, up from 7.0 - XenForo 2.3 already requires 7.2, so this affects XenForo 2.2 forums only
- bugfix: a cron task throwing an
Error, such as aTypeError, no longer stops the rest of the cron tasks due in that run. On XenForo 2.3 it also removed thecronjob from the queue, which stopped every scheduled task on the forum until a cron entry was next saved; on XenForo 2.2 it crashedhg:run-jobs- bugfix:
hg:run-jobsreleases its lock when a job throws, rather than leaving it in place and refusing every run for up to ten minutes withJobRunner already running.- bugfix:
hg:run-cronruns a cron task's class as extended by other add-ons, the same code the scheduler runs, and reports anErrorfrom the task rather than failing with a PHP fatal errorhg:run-jobs --helpgives the real maximum for--max-execution-time: 600 seconds, not 900- README rewritten: requirements, setting up cron and the Job run trigger option, and every command with its options
2.1.2 (2025-12-12)
- run
enqueuePostUpgradeCleanUp()during upgrades if we're running XF2.3+
XF 2.3 compatibility
Update
Important: if you also run my SparkPost addon - you must update that to the new v2.1.0 release after updating this addon
- had required parameters after optional parameters - re-arranging logJobProgress function signature to make it more usable
- added new option
--resetto delete any existing lockfile - useful in situations where a job has crashed without removing the lock and you don't want to wait 10 minutes for the lock to expire
Addon has now been tested on PHP 8.0
Stable release of v2.0.0 - tested on XF 2.2.0 stable
Changes:
- listen to app_cli_setup rather than app_setup do we don't instantiate our SubContainer unnecessarily
- fix an issue where upgrade from v1.5 fails due to legacy Setup.php file
v2.2.0b3 makes some back-end changes to the way we manage the lock files and fixes an issue where long running jobs could see multiple job runners executing at the same time.
This version has also been updated to more closely match some of the structure and options for the core job runner included in XF 2.2
Note breaking change: the--timeoption has been renamed--max-execution-timeinline with the options provided by the XF2.2 core job runner.
Other changes:
- code cleanup: we don't need a custom app class to show jobs
- new CLI command: hg:show-crons
- new CLI command: hg:run-cron
- add logQuiet function to LoggerTrait
- XF2.2 updates the XF time after each queue run
- rebuilt Lock functionality to use a non-static class, managed by a SubContainer
- ensure lock expiry is at least 30 seconds after the max execution time (10 minutes)
We use essential cookies to make this site work, and optional cookies to enhance your experience.