Add configurable exclusions and backup run history

This commit is contained in:
howard committed 2026-11-01 10:53:04 +13:00
1 parent 64cfbeb90c
commit 2351cb6384
6 files changed
+62 -10

No files matched your search

+15
View File
@@ -22,6 +22,9 @@ WAIT_INTERVAL=3
START_RETRIES=1
LOCK_FILE="/run/lock/zorruno-docker-backup.lock"
ZSTD_EXTRA_OPTS="-T0 -12"
TAR_EXCLUDES=""
BACKUP_HISTORY_FILE="/dockervolumes/openclaw/backup-status-mcp/history/backup-runs.jsonl"
BACKUP_HISTORY_DAYS=30
# Optional MQTT reporting and command-listener defaults.
MQTT_REPORT_ENABLED=0
MQTT_HOST=""
@@ -68,6 +71,18 @@ return 0
}
die() { log ERROR "$1"; exit "${2:-1}"; }
# Never let local backups silently fall back to the unencrypted root filesystem.
if [[ "$BACKUP_ROOT" == "/dockerbackups" ]]; then
if ! mountpoint -q /srv/storage || ! mountpoint -q "$BACKUP_ROOT"; then
die "Backup root is not mounted on encrypted storage; refusing to run."
fi
storage_uuid=$(findmnt -n -o UUID -T /srv/storage 2>/dev/null || true)
backup_uuid=$(findmnt -n -o UUID -T "$BACKUP_ROOT" 2>/dev/null || true)
if [[ -z "$storage_uuid" || "$backup_uuid" != "$storage_uuid" ]]; then
die "Backup root is not on encrypted storage; refusing to run."
fi
fi
is_true() {
case "${1,,}" in
1|true|yes|on|enabled) return 0 ;;