Restic - High-Availability Backup Strategie für Immich und Syncthing
High-AvailabilityÜberblick
Backup
Dies Strategyist forein Immichsauberes, andgenerisches SyncthingTemplate einer bewährten, einfachen Backup-Strategie mit einem dedizierten Vault-LXC und Restic mit REST-Server.
Separate Repositories für unterschiedliche Dienste, einfache User-Schleife, direktes Pruning – minimale Komplexität, maximale Zuverlässigkeit.
(SimplifiedVereinfachte & Practicalpraktische Edition – Genericgenerisches Template)
Overview
This is a clean, generic template of a proven, simple backup strategy using a dedicated Vault LXC and Restic with REST server.
Separate repositories for different services, easy user looping, and direct pruning — minimal complexity, maximum reliability.
InfrastructureInfrastruktur (Example Beispiel-Layout)
| Host / |
|||
|---|---|---|---|
| Proxmox VE Host | 192.168.50.10 | Hypervisor, |
|
| Immich LXC | 192.168.50.142 | 142 | |
| Syncthing LXC | 192.168.50.135 | Multi- |
135 |
| Vault/Restic LXC | 192.168.50.220 | 220 | |
| NAS | 192.168.50.80 | Restic |
Read-Only Mount Mount-Points inim Vault Vault-LXC
/tank/subvol-142-disk-1 |
/source/immich |
|
/tank/subvol-135-disk-2 |
/source/syncthing-alice |
|
/tank/subvol-135-disk-3 |
/source/syncthing-bob |
|
/tank/subvol-135-disk-4 |
/source/syncthing-charlie |
ConfiguredKonfiguriert onauf Proxmoxdem hostProxmox-Host withmit read-only mountsMounts (ro=1).
Restic REST REST-Server onauf dem NAS (10.20.20.80:8000)
TwoZwei separate repositories:Repositories:
/photos→authenticatedauthentifiziertwithmituserBenutzerphotos-backup/sync-main→authenticatedauthentifiziertwithmituserBenutzersync-backup
--append-only iswird notnicht used,verwendet, allowingdamit theder backupBackup-Client clientdas toPruning handledirekt pruning directly.übernimmt.
GenericGenerisches Backup Script Backup-Script-Template
PlacePlatziere thisdieses inScript theim Vault Vault-LXC asunter /root/backup-mountpoints.sh:
#!/bin/bash
# SimpleEinfaches backupBackup-Script-Template script template forfür Immich + multi-user Multi-User-Syncthing
# --- CONFIGURATION:KONFIGURATION: IMMICH ---
IMMICH_REPO="rest:http://photos-backup:StrongPhotoPass2025@10.20.20.80:8000/photos"
IMMICH_PASS="StrongPhotoPass2025"
# --- CONFIGURATION:KONFIGURATION: SYNCTHING ---
SYNC_REPO="rest:http://sync-backup:StrongSyncPass2025@10.20.20.80:8000/sync-main"
SYNC_PASS="StrongSyncPass2025"
echo "--- Backup Started:gestartet: $(date) ---"
# ==========================================
# 1. IMMICH BACKUP
# ==========================================
echo "Backing upSichere Immich..."
RESTIC_PASSWORD=$IMMICH_PASS restic -r $IMMICH_REPO backup /source/immich \
--host immich-server --tag "auto" --verbose
# Prune Immich repoImmich-Repo
RESTIC_PASSWORD=$IMMICH_PASS restic -r $IMMICH_REPO forget \
--keep-last 3 --keep-daily 7 --keep-weekly 4 --prune
# ==========================================
# 2. SYNCTHING BACKUP
# ==========================================
echo "BackingSichere up Syncthing Users.Syncthing-Benutzer..."
USERS=("alice" "bob" "charlie")
for USER in "${USERS[@]}"; do
echo "ProcessingBearbeite $USER..."
RESTIC_PASSWORD=$SYNC_PASS restic -r $SYNC_REPO backup "/source/syncthing-$USER" \
--host syncthing-server --tag "user:$USER" --verbose
done
# Prune Syncthing repoSyncthing-Repo (onceeinmalig forfür allalle users)Benutzer)
RESTIC_PASSWORD=$SYNC_PASS restic -r $SYNC_REPO forget \
--keep-last 3 --keep-daily 7 --keep-weekly 4 --prune
echo "--- Backup Finished:abgeschlossen: $(date) ---"
Security hardening:Sicherheitshärtung:
chmod 700 /root/backup-mountpoints.sh
chown root:root /root/backup-mountpoints.sh
AutomationAutomatisierung & SchedulingZeitplanung
Crontab inim Vault Vault-LXC (crontab -e):
0 3 * * * /root/backup-all.mountpoints.sh >> /var/log/restic-backup.log 2>&1
Log rotationLog-Rotation (/etc/logrotate.d/restic):
/var/log/restic-backup.log {
daily
rotate 14
compress
missingok
notifempty
}
Security ModelSicherheitsmodell
Isolation:Isolation:Production containersProduktions-Container (Immich & Syncthing)havehabennokeinennetworkNetzwerkzugriffaccessauftodenthe NAS backup storage.NAS-Backup-Speicher.- Read-
OnlyOnly-Zugriff:Access: VaultVault-LXCcannotkannmodifyLive-Datenornichtdeleteverändernliveoderdata.löschen. Immutability:Immutability:--append-onlyonaufRESTdemserverREST-ServerpreventsverhindertdeletionLöschungofvonsnapshotsSnapshots,evenselbstifwenn Vaultiskompromittiertcompromised.wird.EncryptionVerschlüsselung &Integrity:Integrität: ResticencryptsverschlüsseltallalledataDatenandundperformsführtcryptographickryptografischechecks.Prüfungen durch.
Recovery ExamplesWiederherstellungs-Beispiele
# ListImmich-Snapshots Immich snapshotsauflisten
RESTIC_PASSWORD=StrongPhotoPass2025 restic -r rest:http://photos-backup:...@10.20.20.80:8000/photos snapshots
# RestoreNeueste latestImmich-Version Immichwiederherstellen
RESTIC_PASSWORD=StrongPhotoPass2025 restic -r ... restore latest --target /tmp/restore-immich
# ListNur onlySnapshots Bob'svon snapshotsBob auflisten
RESTIC_PASSWORD=StrongSyncPass2025 restic -r ... snapshots --tag user:bob
# RestoreBob-Daten Bob's datawiederherstellen
RESTIC_PASSWORD=StrongSyncPass2025 restic -r ... restore latest --tag user:bob --target /tmp/restore-bob
ThisDieses templateTemplate preservesbewahrt thedie simplicityEinfachheit andund effectivenessWirksamkeit ofdeines yourfunktionierenden workingSetups, setuphält whileaber keepingalle allBezeichner identifiersgenerisch genericund andsicher. secure.Kopieren, Copy,anpassen adapt,und andsicher deploy confidently!einsetzen!