This commit is contained in:
ryuuseijin 2026-08-17 22:47:22 +08:00
commit 27c4191be8
17 changed files with 730 additions and 0 deletions

16
bin/backup-init.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
: "${AWS_ACCESS_KEY_ID:?AWS_ACCESS_KEY_ID must be set}"
: "${AWS_SECRET_ACCESS_KEY:?AWS_SECRET_ACCESS_KEY must be set}"
: "${RESTIC_REPOSITORY:?RESTIC_REPOSITORY must be set}"
: "${RESTIC_PASSWORD:?RESTIC_PASSWORD must be set}"
if restic snapshots >/dev/null 2>&1; then
echo "Restic repository is already initialized."
exit 0
fi
echo "Initializing restic repository at $RESTIC_REPOSITORY..."
restic init
echo "Restic repository initialized successfully."