Beamfar

What is a cron job?

A cron job is a command that a server runs automatically on a schedule. The name comes from the Unix cron service, which reads a crontab listing a time pattern and a command. Systemd timers and cloud schedulers do the same job.

Definition
Cron job
A task scheduled to run automatically at set times on a server, usually by the cron service; it fails silently unless something watches it.

How they fail

A changed path, a missing environment variable, a full disk, an expired password or an error whose output is mailed to nobody. Nothing visible happens, and the failure is found when the backup is needed or the customer asks why the email never came.

WP-Cron

WordPress has its own scheduler. The WordPress handbook explains that WP-Cron checks scheduled tasks on every page load and runs what is due; it does not run constantly like system cron and it is only triggered by page loads, so tasks can run late on quiet sites. Many agencies run the cron endpoint from a real system cron instead, which then needs monitoring of its own.

An example

The line 30 2 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://monitor.example/ping/TOKEN runs a backup at 02:30 every day. The five time fields are minute, hour, day of month, month and day of week. The && sends the heartbeat only when the script succeeded. Cron uses the server’s time zone, so a server set to UTC runs the job at another hour of the clock than the client’s office assumes. When the job stops, the missing ping is the alert.

What to check

That each job reports success to a heartbeat monitor, that output goes to a log someone can find and that the job’s owner is written down.

Sources

Read on . Standards and vendor pages change; confirm the current text before you rely on it.

Guides that use this term

  • Heartbeat monitoringHeartbeat monitoring waits for a scheduled job to report in and alerts when the signal is missing. How the period and grace time work and what it is good for.
  • Uptime monitoringUptime monitoring requests a website from outside at intervals and alerts when it fails to answer. What it measures, what it misses and how it is confirmed.

Know first. Know why. Tell your client before they call.

Paste your client list. Both regions start checking.

No card for the trial.