How to Detect if a Cron Job Is Not Running (Before It Becomes a Real Problem)
How to Detect if a Cron Job Is Not Running (Before It Becomes a Real Problem) Your backup script was supposed to run every night. Your data import should have triggered at 6 AM. But nobody checked ...

Source: DEV Community
How to Detect if a Cron Job Is Not Running (Before It Becomes a Real Problem) Your backup script was supposed to run every night. Your data import should have triggered at 6 AM. But nobody checked if they actually did. Here's how to catch a cron job not running before the damage is done. The crontab entry is there. You set it up months ago, and since it didn't throw errors, you assumed it's been running fine ever since. Three weeks later you realize your backups haven't been created since February. Your scheduled email digests stopped. Your database cleanup script expired. A cron job not running is one of those problems that hides in plain sight. Unlike a server that crashes loudly, a silent cron just—doesn't happen. No error, no alert, no drama. Just a slow accumulation of missing data, unsent emails, and uncleaned state. This article will show you exactly how to detect it and why heartbeat monitoring is the most reliable approach. The Problem: Cron Jobs That Simply Don't Fire Cron lo