Live backup of 216 on 247 (zareian-pg216-* units, Postgres 16 tools in our dir, SCRAM hash only on 216), backup scripts take PGB_ROOT/PGB_BIN/PGB_PORT with 249 defaults, anti-bot layers documented

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 19:22:56 +03:30
parent bd329f83ae
commit dd98f16d12
11 changed files with 96 additions and 13 deletions

View File

@@ -6,8 +6,9 @@
# restore-check.sh '2026-10-10 16:30:00+03:30'
# با KEEP=1 پوشه و Postgresِ موقت می‌مانند (برای بازیابیِ واقعی: از آن pg_dump بگیرید، بعد pg_ctl stop و rm).
set -euo pipefail
ROOT=/home/administrator/zareian-pgbackup
BIN=/usr/lib/postgresql/14/bin
# ROOT/BIN از یونیت می‌آیند؛ پیش‌فرض‌ها همان بکاپِ ۲۴۹ است (یونیت‌های zareian-pg216-* برای سرورِ جدید).
ROOT="${PGB_ROOT:-/home/administrator/zareian-pgbackup}"
BIN="${PGB_BIN:-/usr/lib/postgresql/14/bin}"
TARGET="${1:-}"
latest=$(ls -1d "$ROOT"/base/2* | tail -1)