Skip to main content

A green ping is not a backup

· 5 min read
Florent Clairambault
Maintainer of SolidPing

Someone on r/selfhosted posted a story last week that should worry anyone who monitors a backup job. Their weekly n8n backup had been "green" for nine months. It was copying the wrong folder. The script ran, exited 0, pinged Uptime Kuma, and went back to sleep. The real database, 2.8 GB, was never touched. The folder it did copy was a 572 KB leftover frozen months earlier. Nine months of green checks, zero usable backups. They only found out during an unrelated incident.

The thread is worth reading: My n8n backup ran green for 9 months and saved nothing. The replies land on the right answers, and they're a good reminder of what a monitor can and cannot do for you.

The trap​

A heartbeat check answers one question: did the job check in? If your backup script pings a URL at the end of a successful run, the monitor turns green when the ping arrives and red when it doesn't. That catches a job that stopped running. It does not catch a job that ran happily and produced nothing useful.

The n8n script exited 0. It pinged. By the only signal the monitor had, everything was fine. The failure was upstream of the ping, in the part that decided what to copy.

So the first lesson is uncomfortable: the monitor cannot tell your backup is empty. It only sees what your script tells it. If your script says "success" while copying the wrong folder, the monitor will faithfully report success. Garbage in, green out.

What actually catches it​

The validation has to live in the backup script, not in the monitor. The thread converges on three cheap checks, in increasing order of paranoia:

  1. Check the size. A real backup of a 2.8 GB database is not 27 MB. Compare the new artifact against the previous one and fail if it shrinks by more than, say, 20%. This alone would have caught the n8n case on week one.
  2. Look inside. A plausible size is not enough. One reply in the thread describes a PocketBase tarball that was the right size and had no data.db inside. tar -tzf backup.tar.gz | grep -q data.db costs nothing and catches the empty-but-plausible case. For a database, sqlite3 backup.sqlite 'PRAGMA integrity_check;' or a row count on a critical table.
  3. Restore it, sometimes. The top reply puts it bluntly: backups don't exist unless you test them regularly. A scheduled restore to a scratch location, followed by a sanity query, is the only thing that proves the whole chain works. Size and content checks are cheap proxies; a restore is the real test.

And one more, about the signal itself: report failure explicitly, don't just stop pinging. If the script detects a bad backup, it should ping with a failure status, not skip the ping. A missing ping eventually alerts, but only after the grace period, and it tells you "the job didn't check in" rather than "the job ran and the backup is bad". The OP's own conclusion in the thread: calling the push URL with status=down on failure beats a missing ping.

Where the monitor fits​

Once the script validates and reports honestly, the monitor's job is simple: alert when the report says down, and alert when the reports stop. That's a heartbeat check, and it's the right tool for this.

SolidPing does this, since I build it and this is the part I can speak to concretely. A heartbeat check expects a periodic signal and opens an incident when it stops, with a grace period so a brand-new check doesn't page you immediately. The signal can carry a status, not just "I'm alive": plus-addressing like <token>+down@…, an X-SolidPing-Status header, or a [DOWN] tag in the subject. So a backup script that ran the size and content checks can report down with a reason, and you get "the backup is bad" rather than "the backup is late". The same pattern works for any cron job you want to prove actually did its work.

I'm not going to pretend a monitor solves this. It doesn't. The n8n failure was a wrong path in a cp command, and no monitoring tool would have caught that. The size check would have. The monitor is the last link: it makes sure the failure your script detected actually reaches a human, and that a script which dies silently doesn't do so for nine months.

So​

Back up, then prove it. Check the size, look inside, restore on a schedule, and make the script report failure as a failure rather than silence. Wire that report to a heartbeat that alerts on both "down" and "gone". The green dashboard is only as honest as the script behind it.

If you've been bitten by a green-but-empty backup, the thread is full of good war stories and cheap checks. And if you want the heartbeat half, SolidPing's heartbeat checks are free and self-hostable, like the rest of it.