Curl a URL on a Schedule with Cron
To ping a URL on a schedule, run curl from cron. Use the silent flags so cron doesn't email output on every run, and add a timeout so a hung request can't stack up.
The crontab line
crontab -e, then add (every 5 minutes):
*/5 * * * * /usr/bin/curl -fsS --max-time 30 https://example.com/health >> /var/log/healthcheck.log 2>&1
What the flags do
-f fails on HTTP errors (non-2xx returns non-zero), -s silent, -S still shows errors, --max-time 30 caps the request so it can't hang forever.
Ping a monitoring service
Services like Healthchecks.io give you a URL to curl on schedule; if the ping stops arriving, they alert you. This turns cron into a dead-man's switch for the job itself.
Trigger a webhook or keep-alive
The same line works to trigger a deploy webhook or keep a free-tier app awake — just point curl at the target URL.
FAQ
How do I curl a URL every 5 minutes with cron?
*/5 * * * * /usr/bin/curl -fsS --max-time 30 https://example.com/health hits it every 5 minutes. Use the absolute path to curl.
How do I stop cron emailing me on every curl run?
Use curl's -s (silent) flag and redirect output: >> /var/log/healthcheck.log 2>&1. Keep -S so real errors still show.
Can cron + curl act as a health check?
Yes. Curl your own endpoint to keep it warm, or curl a monitoring service URL (like Healthchecks.io) so you're alerted if the job ever stops running.