From 0225cfb9d48c15bdcdb653abecab3c13e14862eb Mon Sep 17 00:00:00 2001 From: architect Date: Thu, 26 Nov 2026 23:34:50 +0300 Subject: [PATCH] [ARCH] Daily Prism/Seerr backups with restore evidence --- ops/audit/service_backups.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 ops/audit/service_backups.sh diff --git a/ops/audit/service_backups.sh b/ops/audit/service_backups.sh new file mode 100755 index 0000000..00b251f --- /dev/null +++ b/ops/audit/service_backups.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +STAMP=$(date +%Y%m%d-%H%M) +mkdir -p /mnt/archive/backups/prism /mnt/archive/backups/seerr +export PGPASSWORD=$(cat /root/.pg-superuser-pass) +pg_dump -h 192.168.1.151 -U postgres -d rag -n prism -Fc -f "/mnt/archive/backups/prism/prism-$STAMP.dump" +pct exec 121 -- sh -lc "tar --warning=no-file-changed -czf /tmp/seerr-config-$STAMP.tar.gz -C /opt/seerr/config ." >/tmp/seerr_tar.log 2>&1 +pct pull 121 "/tmp/seerr-config-$STAMP.tar.gz" "/mnt/archive/backups/seerr/seerr-config-$STAMP.tar.gz" >/dev/null +pct exec 121 -- rm -f "/tmp/seerr-config-$STAMP.tar.gz" +find /mnt/archive/backups/prism /mnt/archive/backups/seerr -type f -mtime +30 -delete +ls -lh "/mnt/archive/backups/prism/prism-$STAMP.dump" "/mnt/archive/backups/seerr/seerr-config-$STAMP.tar.gz"