Cron guide
How to Monitor Cron Jobs with Heartbeat URLs
Cron jobs are easy to schedule and easy to forget. A final heartbeat makes the absence of a successful run visible.
Short answer
Call a PulseProbe heartbeat URL at the end of a cron job only after the job succeeds. If the call is missing after the expected interval, PulseProbe alerts you.
Job success vs server uptime
Server uptime only tells you the machine is reachable. Cron heartbeat monitoring tells you whether a specific scheduled job reached its successful end.
Safe shell pattern
Use a placeholder in docs and scripts until you paste the real URL in a private environment. Do not publish the real heartbeat URL.
- 1Run the job command.
- 2Check that it succeeded.
- 3Only then call YOUR_HEARTBEAT_URL with curl or wget.
- 4Log locally that the heartbeat was attempted, without printing the real URL.
Example with placeholders
A private script might use a structure like: run-report.sh && curl -fsS YOUR_HEARTBEAT_URL >/dev/null. Keep the real heartbeat URL out of source control.
Grace windows
- For frequent jobs, allow for normal runtime variance before alerting.
- For daily jobs, account for maintenance windows and slow upstream services.
- For jobs that sometimes skip work intentionally, only send the heartbeat when the outcome should count as successful completion.
How to test
- 1Run the command manually and confirm a check-in.
- 2Let cron run normally once.
- 3Temporarily comment out the heartbeat or disable the job in a safe environment.
- 4Confirm the missed alert after the interval and grace window.
- 5Restore the job and confirm recovery.
When not to use PulseProbe
- Do not use heartbeat monitoring as the only control for safety-critical, medical, emergency, financial trading, or regulated systems.
- Do not send secrets, customer records, prompt text, API keys, or private payloads to the heartbeat URL.
- Heartbeat monitoring proves a check-in arrived. It does not inspect the quality of the workflow output.
FAQ
Should the heartbeat run before or after the job?
After the job, and only after the job exits successfully. Otherwise a failed job can look healthy.
Can I put the heartbeat URL in Git?
No. Treat it like a secret. Use placeholders in source-controlled examples.
Does this replace server monitoring?
No. Use server monitoring for host health and heartbeat monitoring for job completion.