Cron Jobs10 March 20255 min read

Why Your Cron Jobs Are Silently Failing (And How to Fix It)

Your nightly database backup ran fine yesterday. Or did it? Without a way to verify cron job execution, silent failures pile up unnoticed — until the day you desperately need that backup and discover the job stopped working three weeks ago.

Cron JobsUptime MonitoringWebsite MonitoringApi MonitoringCron Job Monitoring
Cron Jobs

Most teams never know when a scheduled task fails until something breaks in production. Here's how heartbeat monitoring catches silent failures before they become incidents.

The silent failure problem

Cron jobs fail silently for many reasons: server reboots that scramble crontab ownership, environment variable changes that break scripts, disk-full conditions that cause writes to fail without error.

Traditional monitoring only watches running services. Cron jobs are different — they're scheduled tasks that should run and complete. If they never start, uptime monitoring tells you nothing.

How heartbeat monitoring works

Heartbeat monitoring flips the model: instead of your monitoring system checking your job, your job checks in with your monitoring system.

1. Create a cron monitor in AlertsDock. You get a unique ping URL. 2. Add `curl -fsS --retry 3 https://alertsdock.com/ping/{uuid}` at the end of your cron job script. 3. AlertsDock expects to receive a ping on your configured schedule. 4. If the ping doesn't arrive within the schedule + grace period, an alert fires.

Grace periods and schedules

A 5-minute grace period is appropriate for most jobs. If your backup job is scheduled at 2:00 AM and takes up to 4 minutes, set a 5-minute grace period — AlertsDock waits until 2:05 before marking the job as late.

For jobs with variable execution times, increase the grace period to match your worst-case runtime.

Start/complete pattern for long jobs

Use the start/complete pattern: ```bash # Beginning of script curl -fsS https://alertsdock.com/ping/{uuid}/start

# ... your job ...

# End of script curl -fsS https://alertsdock.com/ping/{uuid}/complete ```

AlertsDock records duration automatically so you can see trends.

Failure payloads for debugging

When a job fails, the most valuable thing is context: ```bash curl -fsS -X POST https://alertsdock.com/ping/{uuid}/fail \ -H 'Content-Type: application/json' \ -d '{"exit_code": '"$?"', "error": "disk full"}' ```

This payload is stored with the ping record and visible in your AlertsDock dashboard.

This article is available across the supported locale routes — use the language switcher above to change.

Feature Guide

Cron Job Monitoring

Track cron jobs, heartbeat monitors, and scheduled tasks with ping URLs, missed-run alerts, late warnings, and per-job alert routing.

Read guide

Alternative Page

Cronitor Alternative

Compare AlertsDock with Cronitor for teams that want cron monitoring, uptime checks, webhook inspection, and status communication in one platform.

See comparison
AD
AlertsDock Team
10 March 2025
Try AlertsDock free