security hardening + drafts/attachments
This commit is contained in:
26
scripts/restore.sh
Executable file
26
scripts/restore.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <backup-archive.tar.gz>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ARCHIVE="$1"
|
||||
HERE=$(cd "$(dirname "$0")/.." && pwd)
|
||||
|
||||
cd "$HERE"
|
||||
|
||||
echo "[restore] stopping containers..."
|
||||
docker compose down
|
||||
|
||||
echo "[restore] wiping data/..."
|
||||
rm -rf data
|
||||
|
||||
echo "[restore] extracting $ARCHIVE"
|
||||
tar -xzf "$ARCHIVE" -C "$HERE"
|
||||
|
||||
echo "[restore] starting containers..."
|
||||
docker compose up -d --build
|
||||
|
||||
echo "[restore] done"
|
||||
Reference in New Issue
Block a user