What is a Dead Man's Switch and Why Every Dev Needs One
A dead man's switch flips the script on monitoring: instead of checking if a system is up, the system must continually prove it isn't down.
When we talk about infrastructure monitoring, the conversation usually revolves around standard "pings" or uptime checks. You point a monitoring service at your server's IP or a /health endpoint rapidly, and if it fails to respond, you get an alert.
But what happens when the thing you need to monitor isn't a long-running web server? What if it's a transient task, like a daily database backup, an hourly billing roll-up, or a queue worker that spins up and dies?
Enter the Dead Man's Switch (often called Heartbeat Monitoring).
Flipping the Script
In traditional monitoring, the monitor asks the server: "Are you alive?"
With a dead man's switch, the script tells the monitor: "I'm alive right now. If you don't hear from me again in 24 hours, assume I am dead."
This is a profound shift in observability. It allows you to monitor ephemeral processes that exist behind firewalls or inside private VPCs without exposing any public endpoints. Your script simply makes an outbound HTTP POST request when it successfully finishes its job.
Why Do You Need One?
Cron jobs are notorious for failing silently. If a server runs out of disk space, or an API credential expires, the cron job throws an error and dies. The operating system doesn't know it was important, so it doesn't tell anyone.
You only find out next week when a customer complains that their data hasn't refreshed.
By requiring your job to "check in" with a dead man's switch, you guarantee that silence triggers an alarm.
# A simple Dead Man's Switch implementation in Bash
#!/bin/bash
# 1. Run your critical task
pg_dump mydb > backup.sql
# 2. If it succeeds, ping the switch
if [ $? -eq 0 ]; then
curl -m 10 https://ping.cronrabbit.com/your-unique-id
fi
The CronRabbit Approach
At CronRabbit, we've built our entire platform around this concept. We give you a unique URL for every background task you care about. You define the "grace period" (e.g., 1 hour, 1 day, 1 week), and if we don't receive a ping from you in that window, our system immediately alerts your team via Slack, Discord, or Email.
It's time to stop relying on blind faith that your background tasks are running. Build a dead man's switch into your workflow today.
Here is how the dead man's switch works visually:

