Zactonz Cron Doctor

v1.0.0

See whether your cron jobs really run, and fix the ones that do not.

cPanel 102+ (Jupiter)Root to installPHP 7.4+ Updated 30 Sep 2026

cPanel gives you a raw crontab and mails you whatever a job prints. That is enough to add a job and not much else. It will not tell you that a job has been failing since March, that two copies are running on top of each other, that a job calls /usr/bin/php instead of the PHP version the site is set to, or that WordPress cron is being triggered twice.

Cron Doctor wraps each job you choose in a small runner that takes a lock, applies an optional time limit, captures the output and records the exit code and duration. It then shows the last run, alerts you when a job fails or does not run at all, and offers one-click fixes for the common mistakes. The original crontab line is kept, so monitoring can always be undone.

What it does#

  • Records every run of a monitored job: exit code, duration and output, with a size limit.
  • Stops overlapping runs. A job will not start while the previous run is still going. Skipped runs are recorded, so an overlap is visible rather than silent.
  • Mails you only when something is wrong. Cron normally mails you after every run that prints anything. A monitored job stays quiet on success and reports its captured output when it fails.
  • Notices when a job has not run at all, which cron itself can never tell you, and emails you about it.
  • Fixes the PHP path. It finds jobs calling php or /usr/bin/php and offers to switch them to the EasyApache binary the site is actually set to use.
  • Finds the usual problems: duplicated WordPress cron, WordPress still running its own scheduler alongside a real cron job, scripts that no longer exist, output thrown away to /dev/null, an empty MAILTO, Windows line endings, passwords on the command line, and jobs that take nearly as long as the gap between runs.
  • Keeps a way back. The crontab is backed up before every change, every change is logged, and any backup can be restored in one click.

How it fits together#

The plugin installs into cPanel as root and appears under Advanced in every account. Account owners choose which jobs to monitor.

A cron line like this:

*/5 * * * * /usr/bin/php /home/demo/public_html/cron.php >/dev/null 2>&1

becomes this:

*/5 * * * * /home/demo/.zactonz/zcd/bin/zcd-run 4f2c9a10b7d3e185

The command itself is not rewritten into the crontab. It is stored verbatim in the account's own directory and executed from there, so nothing has to survive a second round of shell quoting, a % in a command cannot be turned into a newline by cron, and no text the plugin assembles is ever interpreted as shell. The schedule stays in the crontab, so changing it from cPanel's own Cron Jobs page keeps working.

The runner lives in the account's home directory rather than in the plugin directory. That is deliberate: under CloudLinux CageFS the plugin directory is not visible to the account's cron jobs at all, and it means removing the plugin cannot stop a job that was being monitored.

Safety#

Cron Doctor grants no privilege the account does not already have. Anything the runner executes, the account could already have put in its own crontab.

Every change to a crontab is written by installing a complete file, then reading it back and comparing it with what was intended. A mismatch restores the previous version automatically. A change is refused outright if the crontab moved after the page was loaded, so two browser tabs, or a concurrent edit in cPanel's own Cron Jobs page, cannot silently overwrite each other.

The cPanel API 2 Cron functions are not used for writes. Cron::remove_line takes a single line integer whose meaning is ambiguous between a file line number and a command number, and deleting the wrong cron job is not a recoverable mistake.

Licensing#

Cron Doctor is free and open source under the Apache License 2.0. You may use it on your own servers, modify it, and resell or white-label it under your own brand. It is distributed as-is, without warranty; review the code before running it in production.

Contributing#

The source is on GitHub. Bug reports and pull requests are welcome. bash tools/lint.sh runs everything that has to pass: PHP syntax across supported versions, shellcheck plus dash and bash parsing of every shell script, the source policy check, and the full test suite.