BotPings: AI Agent Alerts
Download on the App Store
Download on the App Store

Watch a cron job on Ubuntu and Debian

Set up a cron monitor on Ubuntu or Debian. Ping BotPings after the job succeeds and report failure so you can see it on your iPhone.

Ubuntu · Debian · 5 min · Servers and scripts

Before you start

Create a BotPings check-in. Set a daily deadline after your job normally finishes. Keep the ping URL in a file readable only by the job’s account.

Steps

Wrap the job

Save this as /opt/jobs/run-and-check-in.sh. Replace /opt/jobs/backup.sh with your job. The file $HOME/.config/botpings/check-in-url should contain only its private URL.

Shell
#!/bin/sh
set -eu
url=$(cat "$HOME/.config/botpings/check-in-url")
if /opt/jobs/backup.sh; then
  curl --fail --silent --show-error --max-time 15 "$url"
else
  status=$?
  curl --fail --silent --show-error --max-time 15 "$url/fail" || true
  exit "$status"
fi

Schedule it with cron

Open the job account’s crontab with crontab -e. This runs at 3 a.m. in cron’s local time zone.

Crontab
0 3 * * * /bin/sh /opt/jobs/run-and-check-in.sh

Use a systemd timer where appropriate

Use a oneshot service with ExecStart=/bin/sh /opt/jobs/run-and-check-in.sh and set User= to the job account. Create a timer with OnCalendar=*-*-* 03:00:00 and WantedBy=timers.target. Start it with systemctl enable --now and check systemctl list-timers.

Test it

Run the wrapper directly as the job account. Confirm its exit status and Last check-in in BotPings before waiting for cron.

The Database backup source showing its nightly schedule and check-in status.

If it doesn’t work

  • The script works in your shell but not from cron. Use absolute paths and verify the account that owns the crontab.
  • The job runs at a different time. Compare the host time zone and the check-in schedule.
  • The URL file cannot be read. Check ownership and permissions for the job account.

Related guides

Checked with BotPings 1.0 in a local test environment, November 2026.