A cron job monitor waits for your job to report in. If no report arrives on time, the monitor goes down and your contacts get an alert. This works for backups, imports, reports and any task that runs on a schedule.
Add a cron job monitor
- Open Uptime and select Add monitor.
- Select Scheduled job, then Continue.
- Enter a name, such as
Nightly backup. - Under Runs every, choose how often the job runs.
- Under Grace time, choose how late the job may be before you get an alert. If the project has no website yet, also enter your website. The job is listed under it.
- Select Continue, then choose who gets alerts.
- The summary shows the private ping URL. Select Copy, and add the URL to your job. The summary shows when the first call arrives.
Call the ping URL from your job
Add one request to the end of your job. Only call the URL when the job succeeds.
0 3 * * * /path/to/backup.sh && curl -fsS -m 10 --retry 3 https://data.dad/ping/YOUR-ID/YOUR-TOKEN > /dev/null#!/bin/sh
set -e
/path/to/backup.sh
curl -fsS -m 10 --retry 3 https://data.dad/ping/YOUR-ID/YOUR-TOKEN > /dev/null& C:\jobs\backup.ps1
if ($?) { Invoke-RestMethod -Uri "https://data.dad/ping/YOUR-ID/YOUR-TOKEN" -TimeoutSec 10 }import urllib.request
run_backup()
urllib.request.urlopen("https://data.dad/ping/YOUR-ID/YOUR-TOKEN", timeout=10)Use the URL from your monitor page instead of YOUR-ID/YOUR-TOKEN. The URL works with GET, HEAD and POST and needs no sign-in.
Report a failure at once
When your job knows it failed, add /fail to the URL. The monitor goes down at once and does not wait for the grace time.
/path/to/backup.sh || curl -fsS -m 10 https://data.dad/ping/YOUR-ID/YOUR-TOKEN/fail
When the monitor goes down
- A new monitor waits for its first ping. It does not alert before that.
- After each ping, the job has the period plus the grace time for the next one. If nothing arrives, the monitor goes down with "No ping received".
- The next ping brings it back up, and your contacts get a recovery alert.
- Periods go from one minute to 30 days. Grace time goes from one minute to seven days.