← Integration guides
Monitor a bash script with curl
Wrap any script so success, failure, and run duration are all reported — including the exact exit code.
A check has a ping URL. Your job calls it on every successful run. If a ping is late past the grace period, CronCanary alerts you. Copy your check's exact URL from its detail page — examples below use $URL.
Report the exit code
The exit-status endpoint takes a number 0–255. 0 = success, anything else = failure → immediate alert:
#!/usr/bin/env bash
curl -fsS $URL/start # mark the run start
/path/to/your-job.sh # do the work
curl -fsS $URL/$? # report exit code ($? from the line above)
Wrap an existing command
run() {
curl -fsS "$URL/start"
if "$@"; then curl -fsS "$URL"; else curl -fsS "$URL/fail"; fi
}
run /path/to/your-job.sh --flags
Send log output with the ping
POST up to 10 KB of body; it's kept with the ping for debugging:
./your-job.sh 2>&1 | curl -fsS --data-binary @- $URL
Ready to wire this up? Create a free check — 20 checks, all alert channels, no card.