docs: add CLAUDE.md, move backup guide into installer, drop linux-to-sync
- CLAUDE.md: full contributor guide — service template, all helpers, globals, DRY_RUN convention, Caddy wiring, non-Docker patterns - services/backup.sh: print backup strategy guide (Kopia/Borg/rsync/ rsnapshot + when to use each) at the start of install_backup() - README.md: remove standalone backup section, fix broken backup row, inline base package list, add CLAUDE.md to layout - services/linux-to-sync.sh: deleted (never worked) - setup.sh: remove linux-to-sync from is_installed() https://claude.ai/code/session_019XgsQ13XKm4Zj3cNsDNwHj
This commit is contained in:
@@ -25,6 +25,68 @@ register_service backup backup "Automatic encrypted backups (Kopia)"
|
||||
install_backup() {
|
||||
log_info "Setting up automatic encrypted backups (Kopia)..."
|
||||
|
||||
echo ""
|
||||
echo "╔═══════════════════════════════════════════════════════════════════╗"
|
||||
echo "║ BACKUP STRATEGIES — choose the right tool for your data ║"
|
||||
echo "╚═══════════════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
echo " This installer sets up Kopia (the recommended default), but here"
|
||||
echo " is a quick guide to all available options so you can pick the"
|
||||
echo " right tool for each type of data."
|
||||
echo ""
|
||||
echo " ┌─────────────────────────────────────────────────────────────────┐"
|
||||
echo " │ KOPIA (installed here) — block-level dedup + zstd + encryption │"
|
||||
echo " │ Use for: files that change constantly — Minecraft worlds, │"
|
||||
echo " │ game saves, Steam prefixes, Docker config volumes. │"
|
||||
echo " │ Changed blocks are stored once; old blocks are shared. │"
|
||||
echo " │ Restores via: kopia snapshot list / kopia restore │"
|
||||
echo " └─────────────────────────────────────────────────────────────────┘"
|
||||
echo ""
|
||||
echo " ┌─────────────────────────────────────────────────────────────────┐"
|
||||
echo " │ BORG (sudo apt install borgbackup) — chunk dedup + encryption │"
|
||||
echo " │ Use for: same as Kopia. Choose Borg if you prefer Borgmatic │"
|
||||
echo " │ (YAML config), Vorta (GUI), or multi-machine repos. │"
|
||||
echo " │ borg init / borg create / borg list / borg extract │"
|
||||
echo " └─────────────────────────────────────────────────────────────────┘"
|
||||
echo ""
|
||||
echo " ┌─────────────────────────────────────────────────────────────────┐"
|
||||
echo " │ RSYNC plain rsync -av --delete /src/ /dest/ │"
|
||||
echo " │ Use for: media, ROMs, files that rarely change and you just │"
|
||||
echo " │ need a copy. Fast, transparent — no special restore tool. │"
|
||||
echo " │ Not suitable for files that change often (one bad --delete │"
|
||||
echo " │ run immediately destroys the only copy in the destination). │"
|
||||
echo " └─────────────────────────────────────────────────────────────────┘"
|
||||
echo ""
|
||||
echo " ┌─────────────────────────────────────────────────────────────────┐"
|
||||
echo " │ RSYNC --link-dest versioned snapshots, original folder layout │"
|
||||
echo " │ Creates dated dirs (2024-01-15/, 2024-01-16/, …). │"
|
||||
echo " │ Unchanged files are hard-linked — cost no extra disk space. │"
|
||||
echo " │ Each dated dir is a complete, browsable snapshot of the │"
|
||||
echo " │ source. Original folder structure preserved (unlike │"
|
||||
echo " │ rsnapshot). If today's --delete wiped something, yesterday's │"
|
||||
echo " │ dated dir is untouched. │"
|
||||
echo " │ Use for: general files where you want versioning + readable │"
|
||||
echo " │ snapshot dirs without a special restore tool. │"
|
||||
echo " └─────────────────────────────────────────────────────────────────┘"
|
||||
echo ""
|
||||
echo " ┌─────────────────────────────────────────────────────────────────┐"
|
||||
echo " │ RSNAPSHOT (sudo apt install rsnapshot) — automated rotation │"
|
||||
echo " │ Wraps rsync with a retention scheme (daily.0, weekly.0, …). │"
|
||||
echo " │ Hard-links unchanged files like --link-dest, but dirs are │"
|
||||
echo " │ named by rsnapshot (not your original structure). │"
|
||||
echo " │ Use for: automated versioning without scripting --link-dest, │"
|
||||
echo " │ when the rsnapshot naming convention doesn't bother you. │"
|
||||
echo " └─────────────────────────────────────────────────────────────────┘"
|
||||
echo ""
|
||||
echo " Quick reference:"
|
||||
echo " Constantly-changing data (saves, worlds, configs) → Kopia or Borg"
|
||||
echo " Media / ROMs (rarely changes, just need a copy) → rsync plain"
|
||||
echo " Versioned snapshots, keep original folder layout → rsync --link-dest"
|
||||
echo " Versioned snapshots, want auto rotation scripted → rsnapshot"
|
||||
echo ""
|
||||
echo " Continuing with Kopia setup..."
|
||||
echo ""
|
||||
|
||||
# ── Repo-conventional paths ──────────────────────────────────────────────
|
||||
local BACKUP_DIR="$DOCKER_DIR/backup"
|
||||
local CONF_FILE="$BACKUP_DIR/backup.conf" # editable settings
|
||||
|
||||
Reference in New Issue
Block a user