Login2Cloud Monitor

How to Monitor a Cron Job

Detect missed backup, ETL and scheduled-task completions with a private heartbeat URL.

Login2Cloud product team · Published 2026-09-27

Why website checks are insufficient

Your website can stay available while a nightly database backup silently stops. A heartbeat reverses the direction of monitoring: the job contacts a private URL after successful work, and the monitoring service detects an overdue completion. Create separate heartbeat monitors for independent jobs so one healthy task cannot hide another failing task.

Set interval and grace

Set the expected interval to the normal time between successful completions. Add grace for ordinary runtime variation or scheduling delay. Login2Cloud shows Late after the expected time and confirms Down after grace and consecutive evaluator failures. Evaluation runs on the scheduler, so a deadline is not a promise of second-exact alert delivery.

Signal success only

Store the private URL in a protected environment variable named HEARTBEAT_URL. In a shell, a basic pattern is: ./backup.sh && curl --fail --silent --max-time 10 "$HEARTBEAT_URL" > /dev/null. The && matters: it keeps a failing job from sending a success signal. Make sure the backup script exits nonzero when its own work fails.

Test failure and recovery

Send an initial success signal and inspect the first result. In a controlled test, stop success pings long enough to exercise grace, confirmation and notification. Resume the job and verify recovery. A heartbeat confirms that a signal arrived; it does not prove the backup can be restored. Continue separate restore validation.

Keep the URL private

The URL is a credential. Do not put it in public repositories, screenshots or verbose command logs. Rotate it if disclosed and update the job immediately because the previous URL stops working. A new heartbeat starts with a deadline even before the first ping, so incomplete setup can correctly become overdue.

Common questions

Does Login2Cloud run my cron job?

No. Your scheduler runs the job; Login2Cloud watches for its success signal.

Can a heartbeat prove a backup is restorable?

No. Add independent restore tests. A successful signal is only as reliable as the job’s success criteria.

Next steps