Uptime Kuma moved from esh-docker-vm to ana-docker on 2026-09-22. The pre-backup hook's fallback lookup, `docker ps | grep -E "uptime.kuma"`, then matched nothing and exited 1. Under set -euo pipefail that aborted the hook, and resticprofile treats a failed run-before as fatal, so no snapshot was taken from 2026-09-22 01:00 until this fix (backup-freshness: 54h stale). The block is removed rather than guarded because there is nothing on this host left for it to back up. The header now records the invariant the "blocks only WARN" promise depends on: every optional-service lookup must sit inside an `if` test or end in `|| true`. The remaining blocks were checked and all do. Deployed with playbooks/esh-docker-vm-restic-drop-kuma-block.yaml (the pre-fix hook is kept in /var/lib/restic/repair-20260923/). The live hook hash matches the canonical copy (43e6bea8b8569602). The manual backup saved snapshot 6ec9f74f, and backup-freshness now reports all backups fresh.
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
# esh-docker-vm: install the pre-backup hook without the uptime-kuma block.
|
|
#
|
|
# Kuma moved to ana-docker on 2026-09-22. The old block's unguarded
|
|
# `docker ps | grep uptime.kuma` lookup then matched nothing, exited 1, and
|
|
# set -euo pipefail aborted the hook. resticprofile treats a failed run-before
|
|
# as fatal, so every nightly backup since 2026-09-22 01:00 was skipped.
|
|
#
|
|
# Rerunnable: the preserve step is `creates:`-guarded, and the upload only
|
|
# changes the file when the content differs.
|
|
|
|
steps:
|
|
- name: Preserve the pre-fix hook
|
|
sudo: true
|
|
shell: |
|
|
set -eu
|
|
install -d -m 0700 /var/lib/restic/repair-20260923
|
|
cp -p /etc/restic/pre-backup.sh /var/lib/restic/repair-20260923/pre-backup.sh
|
|
creates: /var/lib/restic/repair-20260923/pre-backup.sh
|
|
|
|
- name: Install the hook without the uptime-kuma block
|
|
sudo: true
|
|
upload:
|
|
src: configs/restic/esh-docker-vm/pre-backup.sh
|
|
dest: /etc/restic/pre-backup.sh
|
|
mode: '0700'
|
|
|
|
verify:
|
|
- name: Hook parses under bash
|
|
sudo: true
|
|
shell: bash -n /etc/restic/pre-backup.sh
|
|
|
|
- name: No uptime-kuma lookup left in the live hook
|
|
sudo: true
|
|
shell: "! grep -q 'UK_CONTAINER' /etc/restic/pre-backup.sh"
|
|
|
|
- name: Hook runs to completion (stage summary line reached)
|
|
sudo: true
|
|
shell: /etc/restic/pre-backup.sh 2>&1 | grep -q 'stage ready:'
|