Skip to content

Cron

Add a ping to the end of your cron line so it fires every time the job runs successfully.

Crontab

Open your crontab with crontab -e and chain the ping after your command with &&:

Terminal window
0 3 * * * /opt/run-backup.sh && curl -fsS https://didmyjobrun.com/ping/<your-key>
  • Replace <your-key> with your monitor’s URL from the dashboard.
  • The && means the ping only fires if run-backup.sh succeeded (exit code 0). If the job fails, no ping is sent and you get alerted — which is the point.
  • The -fsS flags keep cron’s output quiet on success while still surfacing real errors.

That’s it. Set your monitor’s period to match the schedule (here, 1 day) and add a little grace for jobs that occasionally run late.

Pinging from inside a script

If your cron line runs a script, you can put the ping at the very end of the script instead, so it only runs after all the work succeeds:

#!/usr/bin/env bash
set -e # exit immediately if any command fails
# ... do the work ...
curl -fsS https://didmyjobrun.com/ping/<your-key>

With set -e, any failing step aborts the script before it reaches the ping.

systemd timers

If you use a systemd timer instead of cron, add the ping as the last ExecStart line (or at the end of the script the unit runs):

[Service]
Type=oneshot
ExecStart=/opt/run-backup.sh
ExecStart=/usr/bin/curl -fsS https://didmyjobrun.com/ping/<your-key>

systemd runs each ExecStart only if the previous one succeeded, so a failed backup never reaches the ping.