Add healthchecks.io dead-man's-switch to paperless backup - #102
Open
michaelbarton wants to merge 1 commit into
Open
Add healthchecks.io dead-man's-switch to paperless backup#102michaelbarton wants to merge 1 commit into
michaelbarton wants to merge 1 commit into
Conversation
2 tasks
michaelbarton
force-pushed
the
add/paperless-backup-healthcheck
branch
from
August 10, 2026 22:10
d1c6298 to
0abf99e
Compare
We just found the daily backup LaunchAgent was never actually loaded on this machine, so the job silently didn't run for 62 days with no error to notice — a plain "notify on script failure" wouldn't have caught this since the script never even started. backup.sh now pings a healthchecks.io check on success, and its /fail endpoint via an ERR trap if any step fails. If the ping doesn't arrive on schedule (crashed run, unloaded agent, machine off), healthchecks.io raises the alert externally instead of relying on something local to notice its own absence. The ping URL is optional (read from Keychain) so backup.sh still runs fine without it configured. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
michaelbarton
force-pushed
the
add/paperless-backup-healthcheck
branch
from
August 10, 2026 22:26
0abf99e to
c8cfae4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
backup.shnow pings a healthchecks.io check on success, and its/failendpoint (via anERRtrap) if any step fails.paperless-backup-healthcheck-url); if unset,backup.shjust skips the ping and behaves exactly as before.Test plan
bash -n backup.sh— syntax check passes.ERRtrap, logs the failure, and best-effort pings/failwithout the ping itself being able to crash the script (|| true).ping_healthcheckafter "Paperless backup complete" and exits 0.Follow-up (manual, one-time)
Documented in
ansible/tasks/paperless_backup.yml: create a free check at healthchecks.io with a 24h period (~a few hours grace) matching the daily 3am schedule, then:🤖 Generated with Claude Code