Heartbeat monitors for cron jobs
Have scheduled jobs ping Timmy, and hear when one stops.
How it works
Most monitors reach out to your service. A heartbeat works the other way round: your job calls a secret URL each time it finishes, and Timmy raises the alarm when the call doesn't come.
The deadline is the last ping plus the expected interval plus the grace period. Miss it and the heartbeat goes Cancelled, with a cause such as 'No ping since 14:05 UTC, expected every 5 min'. The next ping puts it back on time.
Create one
Heartbeats aren't limited by your plan's shortest check interval. Lost the URL? Open the monitor and click New ping URL; the old one stops working at once.
- Go to Departures, click + Add departure and choose Cron job (heartbeat).
- Enter a Name, such as Nightly backup.
- Set Pings expected: every 1, 5, 10, 15 or 30 minutes, 1, 2, 6, 12 or 24 hours, or once a week.
- Set Grace (minutes), from 1 to 1,440 (one day). Allow for how long the job runs and how much its start time drifts.
- Click Add heartbeat and copy the ping URL straight away: it's shown only once. We keep only a hash of it.
The ping URL
- Format: https://www.uptimetimmy.com/ping/<your-token>, with a 32-character secret token.
- GET, POST and HEAD all work. Any request body is ignored.
- Answers 200 with the text OK. An unknown token answers 404.
- Pings less than 5 seconds apart count as one.
In a crontab
Put the ping after your command with &&, so a failed run doesn't ping. -f makes curl fail on an error status, -m 10 gives up after 10 seconds and --retry 3 rides out a brief network problem.
# Every day at 03:00
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://www.uptimetimmy.com/ping/<your-token> > /dev/nullIn GitHub Actions
Store the URL as a repository secret (here HEARTBEAT_URL) and ping as the last step. Steps stop at the first failure, so a failed run never reaches it.
on:
schedule:
- cron: "0 3 * * *"
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/nightly.sh
- name: Tell Uptime Timmy it ran
run: curl -fsS -m 10 --retry 3 "${{ secrets.HEARTBEAT_URL }}" > /dev/nullWith a systemd timer
In the service unit, ExecStartPost runs only after ExecStart succeeds.
# /etc/systemd/system/backup.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
ExecStartPost=/usr/bin/curl -fsS -m 10 --retry 3 https://www.uptimetimmy.com/ping/<your-token>Not supported yet
- Start, fail or exit-code signals, and measuring how long a job ran.
- Schedules written as cron expressions: heartbeats use the fixed intervals above.
Still stuck? Email support@uptimetimmy.com.