Job & Cron Monitor

Job & Cron Monitor 3.1.2

No permission to download

3.1.2 (2026-10-14)​

  • job-monitor:validate accepts --unattended. Other add-ons use the option to skip a check that sends something, such as a test email; these checks send nothing, so it changes nothing here. It is accepted so that a monitor can run every add-on's validate with the same options
  • Like
Reactions: VBX Co
Major update: renamed from CLI Job Runner to Job & Cron Monitor - this tool no longer runs your jobs and hg:run-jobs is deprecated, use the core xf:run-jobs instead. 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_redaction code event, which is never fired on a forum without that add-on

3.1.0 (2026-10-08)​

  • job-monitor:health-check is now job-monitor:validate, and its exit codes have changed. It exits 1 if any check found a problem and 0 otherwise, warnings included, so a deploy or a cron job can depend on it. It used to exit 1 on a warning and 2 on a problem. The old name now checks nothing and exits 1, so anything still calling it fails loudly
  • new: --strict makes a warning exit 2, for a monitor that should hear of one. 1 still 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. --json reports these as skipped, and gains a strict key
  • 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 old hg: names beside them. hg:show-jobs, hg:show-crons, hg:run-cron and hg:test-jobs still work in 3.x, but no longer appear in list

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 own xf:run-jobs does, and this add-on is for watching and diagnosing it. See
"Upgrading from 2.x" in the README.

  • change your crontab from hg:run-jobs to xf:run-jobs. hg:run-jobs still works - it now runs xf:run-jobs with the same options and prints nothing of its own - but will be removed in a later major version. --reset is accepted and ignored
  • commands renamed: job-monitor:run-jobs, job-monitor:show-jobs, job-monitor:show-crons, job-monitor:run-cron and job-monitor:queue-test-job. The old hg: names still work in 3.x
  • job-monitor:run-jobs logs each job and cron task without -v; --max-execution-time=0 runs until the queue is empty
  • new: job-monitor:health-check checks that jobs and cron are running - the cron job queued, overdue jobs and cron tasks, failed jobs, and an old crontab still calling hg:run-jobs. Exits 0, 1 or 2; --fix re-queues a missing cron job; --json for monitoring
  • new: on XenForo 2.3 every failed job is recorded, not only in debug mode, and job-monitor:show-failed-jobs lists them
  • new: every job and cron task run is timed and kept hour by hour for 90 days; job-monitor:show-stats shows 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-jobs now 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 Error now 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 a TypeError, no longer stops the rest of the cron tasks due in that run. On XenForo 2.3 it also removed the cron job from the queue, which stopped every scheduled task on the forum until a cron entry was next saved; on XenForo 2.2 it crashed hg:run-jobs
  • bugfix: hg:run-jobs releases its lock when a job throws, rather than leaving it in place and refusing every run for up to ten minutes with JobRunner already running.
  • bugfix: hg:run-cron runs a cron task's class as extended by other add-ons, the same code the scheduler runs, and reports an Error from the task rather than failing with a PHP fatal error
  • hg:run-jobs --help gives 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+
  • Like
Reactions: VBX Co
Update
  • had required parameters after optional parameters - re-arranging logJobProgress function signature to make it more usable
  • added new option --reset to 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
Important: if you also run my SparkPost addon - you must update that to the new v2.1.0 release after updating this addon

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 --time option has been renamed --max-execution-time inline 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)
  • Like
Reactions: yin9
remove redundant class extension thanks to XF 2.2b2
  • Like
Reactions: yin9
Back
Top Bottom