You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
368 B
Bash

#!/usr/bin/env bash
# backend/scripts/restore.sh <backup.db.gz> — 복구(재기동 필요)
set -euo pipefail
SRC="${1:?usage: restore.sh /backups/ari-<ts>.db.gz}"
DB="${DATABASE_URL:-sqlite:////data/ari.db}"
DB_PATH="${DB#sqlite:///}"
TMP="$(mktemp)"
gunzip -c "$SRC" > "$TMP"
mv "$TMP" "$DB_PATH"
echo "restored $SRC$DB_PATH (backend/worker 재기동 필요)"