Zum Inhalt springen
#0182
CronNotificationsSqlite+1

The cron that watches the cron

You have a nightly job that exports analytics to a partner. It used to run silently: and silently fail. The partner emailed three weeks later asking where the data went.

Now the job's last action is a PUT to hoody-sqlite: the timestamp of the last successful run, keyed by job name. A second cron, on a 6-hour schedule, reads that timestamp. If it's older than 25 hours, it POSTs to hoody-notifications: urgency: critical, summary: "analytics-export silent for 25h+", body with the actual timestamp.

The watcher cron is twelve lines of bash. The notification fires on the same display tab where every other alert lands. The job that should have been running announces itself by not announcing itself.

Used to need Cronitor or healthchecks.io for this. Now it's two crons in the box you already rent, talking through SQLite and a notification.

Silent failure has a phone number now.