Accumulated uncommitted infra changes: - Caddyfile: repoint HA/Zabbix to 192.168.1.4/.3, add ~20 new site routes - Immich: move media to /mnt/smsg, enable CUDA ML, mem limits, rewrite backup.sh - Add service stacks: agap-mcp, anki, family, freshrss, iperf3, kanboard, linkwarden, qbittorrent, radicale, syncthing, vikunja, windows - openwebui: enable API keys; ollama: drop CPU fallback - seafile/zabbix: extra_hosts entries; matrix: add user juris - Remove pihole stack and stale wiki/migrate.py - Ignore marketplace-mcp (standalone repo) and linkwarden runtime data Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
43 lines
1.1 KiB
Bash
Executable File
43 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
BACKUP_DIR=/mnt/toshiba/backups/media
|
|
LOG="$BACKUP_DIR/backup.log"
|
|
VERBOSE=0
|
|
|
|
for arg in "$@"; do
|
|
case $arg in
|
|
-v|--verbose) VERBOSE=1 ;;
|
|
esac
|
|
done
|
|
|
|
log() { echo "[$(date)] $*" >> "$LOG"; }
|
|
say() { [[ $VERBOSE -eq 1 ]] && echo "$*" || true; }
|
|
|
|
|
|
mkdir -p "$BACKUP_DIR"
|
|
|
|
say ""
|
|
say "┌─────────────────────────────────────┐"
|
|
say "│ Immich Backup Starting │"
|
|
say "└─────────────────────────────────────┘"
|
|
say ""
|
|
log "Starting Immich backup"
|
|
|
|
# Rsync critical asset folders (skip thumbs and encoded-video — regeneratable)
|
|
RSYNC_OPTS="-a --ignore-existing"
|
|
[[ $VERBOSE -eq 1 ]] && RSYNC_OPTS="$RSYNC_OPTS --info=progress2"
|
|
|
|
for DIR in library upload profile; do
|
|
say " Syncing $DIR/ ..."
|
|
rsync $RSYNC_OPTS /mnt/smsg/media/upload/$DIR/ "$BACKUP_DIR/$DIR/" 2>&1 | \
|
|
tee -a "$LOG" | { [[ $VERBOSE -eq 0 ]] && cat > /dev/null || cat; }
|
|
log "Synced $DIR"
|
|
say ""
|
|
done
|
|
|
|
touch "$BACKUP_DIR/.last_sync"
|
|
log "Immich backup complete"
|
|
say "✓ Done"
|
|
say ""
|