Use case: cron jobs

Cron Job Failure Alerts by Phone Call

Edesy OnCall watches scheduled jobs with heartbeats. Your job calls a secret URL each time it finishes. If the ping doesn't arrive within the expected period plus a grace time, or the job reports a failure, OnCall phones your team in English or Hindi until someone presses 1. One curl line in crontab is all it takes.

1 line

Added to your crontab

Up to 24 h

Expected period

Up to 24 h

Grace time

Free

For 3 monitors

Works with any scheduler

Report failures instantly

Calls until someone presses 1

Heartbeat monitoring at a glance

How OnCall decides a job has failed

ItemEdesy OnCall
Ping URLhttps://oncall.edesy.in/hb/<token>, unique per monitor; any HTTP method works
Late pingNo ping within the expected period plus grace opens an incident
Instant failureCall the URL with ?status=fail&msg=... to open an incident at once
Expected periodFrom your plan's minimum (5 minutes on Free) up to 24 hours
Grace time0 to 24 hours, 2 minutes by default, to allow for slow runs
RecoveryThe next successful ping resolves the incident
Token leakRotate the token on the monitor page; the old URL stops working

Monitor a cron job in four steps

No agent to install

  1. Step 1 of 4: Create a heartbeat monitor

    In OnCall, add a Heartbeat monitor and set how often the job runs, plus a grace time for slow runs. Attach an escalation policy.

  2. Step 2 of 4: Copy the ping URL

    Each heartbeat monitor has its own secret URL. Keep it private.

  3. Step 3 of 4: Add one line to the job

    Append && curl to the crontab line so the ping is sent only when the job succeeds.

  4. Step 4 of 4: Report failures straight away

    Optionally call the URL with status=fail from your script's error path, so you hear about it before the ping is even late.

The crontab lines

# Nightly backup at 02:00. Ping only if it succeeded (-f makes curl fail on HTTP errors).
0 2 * * *  /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://oncall.edesy.in/hb/<token> > /dev/null

# Same job, but also report a failure at once instead of waiting for the ping to go missing
0 2 * * *  if /usr/local/bin/backup.sh; then curl -fsS -m 10 --retry 3 https://oncall.edesy.in/hb/<token> > /dev/null; else curl -fsS -m 10 -G --data-urlencode status=fail --data-urlencode "msg=backup failed" https://oncall.edesy.in/hb/<token> > /dev/null; fi

For a nightly job, set the expected period to 24 hours and the grace to a little more than the job's longest run. Jobs that run less often than once a day (weekly, monthly) can't be watched with a heartbeat today, because the longest expected period is 24 hours.

The cron heartbeat URL generator builds these lines for your schedule, and the cron expression builder helps you write the schedule itself. Full reference: heartbeat monitors.

Jobs worth a heartbeat

The ones that fail quietly

Database backups

Know the same night if a dump didn't run, not on the day you need it.

Reports and exports

Daily sales reports, GST exports, product feeds and invoices.

Sync jobs

Inventory, price and order syncs between your store, ERP and marketplaces.

Queue workers

Have a worker ping after each batch so a stuck queue is caught.

Cron job failure alerts: FAQ

Running many scheduled jobs?

Tell us what runs on a schedule and who should be called when it doesn't. We reply within one working day.

Never find out about a failed backup too late

Add a heartbeat to your most important job on the Free plan. Prices exclude 18% GST.