#!/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