Getting started
Curl Cron Job Monitoring
Sometimes you aren’t writing a script; you are just running a command line utility or checking if a server is up. In these cases, curl is your best friend.
olic.io works natively with curl because our entire platform is based on HTTP requests. If you can access the internet, you can monitor it.
Using Curl to Monitor Tasks
You can use curl inside shell scripts, batch files, or CI/CD pipelines. The goal is to fire a request to your unique URL when a set of shell commands completes.
Implementation
Here is a robust snippet you can use in any Bash script:
#!/bin/bash
# Define your heartbeat URL
HEARTBEAT_URL="https://api.olic.io/ping/YOUR-ID-HERE"
# --- YOUR CORE LOGIC HERE ---
echo "Syncing files..."
rsync -av /source /dest
# Capture the exit code of the last command
EXIT_CODE=$?
# ----------------------------
if [ $EXIT_CODE -eq 0 ]; then
# Success: Ping olic.io
curl -fsS --retry 3 $HEARTBEAT_URL > /dev/null
echo "Job verified."
else
echo "Job failed."
# Optional: You could use a separate olic.io URL for failure alerts here
fi
This simplicity is why we emphasize Easy to maintain integrations. There is no software to update; just a URL to hit.
Why Curl for Automation
Curl is the universal connector. It is installed on virtually every server, making it the fallback tool for Running healthchecks across diverse environments.
It is particularly useful for “glue” tasks—quick one-liners that check disk space or verify an API is responding. By wrapping these commands with an olic.io ping, you transform ad-hoc commands into reliable, monitored infrastructure.