Cron jobs and scheduled tasks
Heartbeat monitoring for cron jobs and backups
A healthy website does not tell you whether last night’s backup ran. Have the job send Upteno a signal, then watch for a missing completion, a late run, or an explicit failure.
Let the job report its own outcome
Heartbeat monitors receive signals rather than dispatching probes to a host. Each monitor has a private URL that accepts GET or POST requests, with optional /start, /success, and /fail signals. Use /success only after the work and its required validation have completed. For a backup, that might mean checking the archive or verifying the upload first. A received signal proves that the job reported success; it does not independently prove the backup can be restored.
Match the schedule and allow for normal variation
Create a Heartbeat monitor and choose an expected interval from 60 seconds to 31 days. Add a grace period for normal scheduler delays or variable runtime, then review the monitor state settings. For example, a daily backup can use a 24-hour interval and a grace period based on its observed runtime variation. Choose the grace period deliberately: a larger margin also means a missing signal takes longer to be detected.
Connect and check the reporting path
1. Copy the private heartbeat URL from the monitor into your job’s secret configuration. Keep it out of public repositories and logs. 2. Send /start when work begins, /success after a verified successful run, and /fail on an error path. Ensure failures in the heartbeat request are visible in your job logs. 3. Configure and test the recipient contacts. Review the monitor after a successful run and a controlled failure before depending on the alerts.
Handle a missing signal with context
A missing heartbeat can mean the job did not run, the host lost network access, or the reporting request failed. Use the job logs and monitor history together to distinguish those cases. Heartbeat history shows availability rather than request-latency charts. There is no remote probe location or measured HTTP response time to infer from an inbound job signal.
Protect and rotate the heartbeat URL
Anyone with the private URL can send a signal for that monitor. Regenerating the URL immediately invalidates the old token, so update every sender after rotation. Request bodies are limited to 4 KB and used as bounded diagnostic text. Send only the detail needed to investigate the job, without credentials or personal data.