[ARCH] Daily Prism/Seerr backups with restore evidence
This commit is contained in:
1 parent
c96a1853e3
commit
0225cfb9d4
1 file changed
+11
Executable
+11
@@ -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"
|
||||
Reference in new issue
Block a user