Monitor Cron Jobs Inside Docker
A cron daemon running inside a long-lived container (or a scheduled one-off container run) has failure modes beyond a plain host crontab — the container can keep running from Docker's point of view even after its cron process has silently died.
Setup
Create an incoming monitor
Add a heartbeat monitor in Pingtastic matching the job's schedule.
Ping at the end of the container's script
Add the ping call after the real work succeeds.
#!/bin/sh
# ...existing backup logic...
curl -fsS https://ping.pingtastic.net/ping/nightly-backupOr ping after a scheduled one-off container run
If a host crontab entry runs `docker run` on a schedule instead of cron living inside a long-lived container, ping after the container exits successfully.
0 3 * * * docker run --rm myorg/backup-tool:latest && curl -fsS https://ping.pingtastic.net/ping/nightly-backupGotchas
- ⚠A container running cron as PID 1 can silently stop processing jobs if the cron daemon itself crashes while the container stays "running" from Docker's point of view — container-health monitoring alone won't catch this, only a ping tied to the actual job succeeding will.
- ⚠If the container's base image doesn't include a working curl, add it explicitly — minimal images like alpine or scratch-based builds often don't have it by default.
Questions
Is it better to run cron inside the container or on the host?
Both work for monitoring purposes — the ping just needs to happen after your job's real work succeeds, regardless of whether the scheduling mechanism lives inside the container or on the host triggering docker run.
Does this work with Docker Compose's healthcheck?
Docker Compose healthchecks verify the container is alive, not that a specific scheduled job inside it actually ran — they're complementary, not a substitute for a heartbeat ping.
Related guides
Start monitoring your Docker container cron
Set up your first monitor in under five minutes.
Get started — $5/month