Cron job monitoring setup guide
Connect a scheduled task to CronShieldLabs with one HTTP request at the end of a successful run.
1. Create a monitor
Create an account, open the dashboard, select New Monitor, and choose the schedule that matches your task.
2. Copy your private ping URL
Every monitor receives a unique URL. Keep it private: anyone with the URL can record a successful check-in.
https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN
3. Ping only after success
Place the request after the task completes successfully. If the task exits early or fails, no ping is sent and CronShieldLabs can alert you.
Shell or cron
/path/to/backup.sh && curl --fail --max-time 10 --retry 2 "https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN"
PHP
$url = 'https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN';
$context = stream_context_create(['http' => ['timeout' => 10]]);
file_get_contents($url, false, $context);
Python
import requests
requests.get(
"https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN",
timeout=10,
).raise_for_status()
4. Report start and failure events
For duration tracking, ping /start before the job. If the command fails, ping /fail?exit_code=1. The plain monitor URL records success and sends a recovery notice when needed.
curl --fail "https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN/start"
/path/to/backup.sh
code=$?
if [ "$code" -eq 0 ]; then
curl --fail "https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN"
else
curl --fail "https://app.cronshieldlabs.com/ping/YOUR_MONITOR_TOKEN/fail?exit_code=$code"
fi
5. Test the complete failure path
- Run the task manually and confirm a successful ping appears.
- Temporarily disable the ping or use a short test interval.
- Confirm the monitor changes state and the alert reaches your inbox.
- Restore the production schedule.
Optional equipment resources
Running scheduled jobs on a mini PC, network device, or home-lab server? You can browse current electronics deals on Amazon.
Affiliate disclosure: As an Amazon Associate I earn from qualifying purchases.