Files
Assistant/deploy/verify-latest-postgres-backup.sh
m e9594306e5
CI / test (push) Successful in 10s
ops: add verified PostgreSQL backups
2026-08-16 17:53:40 +03:00

14 lines
456 B
Bash
Executable File

#!/bin/sh
set -eu
backup_root="${ASSISTANT_BACKUP_DIR:-/home/m/assistant-backups/postgres}"
verify_script="${ASSISTANT_RESTORE_VERIFY_SCRIPT:-/home/m/assistant-ops/verify-postgres-restore.sh}"
latest="$(find "$backup_root" -mindepth 1 -maxdepth 1 -type d ! -name '.*' -printf '%f\n' | sort | tail -n 1)"
if [ -z "$latest" ]; then
echo "No completed PostgreSQL backup found in $backup_root" >&2
exit 1
fi
exec "$verify_script" "$backup_root/$latest"