AI given structure
This commit is contained in:
24
backup.sh
Executable file
24
backup.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Backup all persistent service data using Restic
|
||||
set -euo pipefail
|
||||
|
||||
# Load environment
|
||||
source .env
|
||||
|
||||
export RESTIC_REPOSITORY=/mnt/storage/backups
|
||||
export RESTIC_PASSWORD_FILE=/root/.restic_pass
|
||||
|
||||
SERVICES=(gitea nextcloud qbittorrent jellyfin devbox obsidian traefik)
|
||||
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
target="${STORAGE_PATH}/${svc}"
|
||||
if [ -d "$target" ]; then
|
||||
echo "Backing up $svc..."
|
||||
restic backup "$target" --tag "$svc"
|
||||
else
|
||||
echo "Skipping $svc - directory $target not found"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Backup complete."
|
||||
restic snapshots --latest 5
|
||||
Reference in New Issue
Block a user