Bash Scripts

Add ping calls directly in your shell scripts for more control over error handling:

backup.sh
#!/bin/bash
set -e

PING_URL="https://watchcron.com/ping/your-uuid"

# Signal start
curl -fsS --retry 3 "$PING_URL/start"

# Your actual work
/usr/bin/backup-database.sh
/usr/bin/cleanup-logs.sh

# Signal success
curl -fsS --retry 3 "$PING_URL"
With error handling and trap
#!/bin/bash

PING_URL="https://watchcron.com/ping/your-uuid"

# Send failure signal on any error
trap 'curl -fsS "$PING_URL/fail"' ERR

curl -fsS "$PING_URL/start"

# If any command below fails, the trap fires automatically
/usr/bin/backup-database.sh
/usr/bin/upload-to-s3.sh
/usr/bin/cleanup-temp.sh

curl -fsS "$PING_URL"
Using trap ... ERR automatically sends a fail signal if any command in the script exits with a non-zero code. This is more robust than manually checking each step.