Cronjob

Cron job scheduler service for webtrees

License: GPL v3 webtrees major version

A cron job scheduler service for webtrees: schedule maintenance/batch jobs with standard cron expressions, watch their run history in the admin UI, and trigger them manually. The module is the service; the OS (classic cron or a systemd timer) only has to call one small script once per minute.

  • Job registry + run history in two own tables (cj_job, cj_run)
  • Admin UI (control panel): job list, create/edit form, run history, run now, enable/disable, delete
  • Isolated execution: every job runs as a separate child PHP process (proc_open, no shell), with per-job timeout and captured output
  • Self-registration: other modules can advertise their jobs (a cron-jobs.php manifest or a getCronJobs() method); they appear here, created disabled and ready to enable
  • Event-driven jobs: jobs can fire on events instead of a schedule — queued by a token-protected webhook, by a direct EventQueue::push() call from other modules, by the built-in pseudo-event pollers, or by route events
  • Failure notification: per-job opt-in to alert the site’s administrator accounts when a job fails
  • Offline awareness: while data/offline.txt exists the tick is skipped before any database access
  • No core changes, no changes to other modules

Cronjob Scheduler

It was originally developed as a support module for LinkEnhancer to keep its indexes up to date.

Support


Setup

Installation and requirements

Usage

Creating jobs, run history, and the admin UI

The Tick

How the once-a-minute tick schedules and runs jobs

Events

Event-driven jobs, webhooks, pseudo-events, and route events

Howto

How can other custom modules make use of this cronjob module?

CLI Scripts

Command-line scripts and maintenance

Security

Security model and command validation

Last modified November 8, 2026: php doc references (f831d42)