Backup + Skript für wled
|
|
||
|---|---|---|
| backup_wled.sh | ||
| last_backup.txt | ||
| README.md | ||
| wled-wled-chchsign-config.json | ||
| wled-wled-chchsign-presets.json | ||
| wled-wled-doppelstreifen-config.json | ||
| wled-wled-doppelstreifen-presets.json | ||
| wled-wled-matrix-config.json | ||
| wled-wled-matrix-presets.json | ||
| wled-wled-matrix450-config.json | ||
| wled-wled-matrix450-presets.json | ||
| wled-wled-ringtest-config.json | ||
| wled-wled-ringtest-presets.json | ||
| wled-wled-stripe-config.json | ||
| wled-wled-stripe-presets.json | ||
| wled-wled-text-config.json | ||
| wled-wled-text-presets.json | ||
| wled_backup_20260317_210154.log | ||
| wled_backup_20260317_210753.log | ||
| wled_backup_20260317_212145.log | ||
WLED Backup
Sichert alle WLED-Instanzen im lokalen Netzwerk via mDNS (Avahi).
Sinn
Der Chaos Computer Club Chemnitz (ChCh) betreibt mehrere WLED-Controller für die Lichtsteuerung. Dieses Skript sichert regelmäßig:
- Presets: Alle gespeicherten Licht-Presets (
/presets.json) - Konfiguration: Vollständiger Gerätezustand (
/json)
Dateinamen
wled-<hostname>-presets.json
wled-<hostname>-config.json
last_backup.txt # ISO-Datum des letzten Backups
Installation
chmod +x backup_wled.sh
Nutzung
./backup_wled.sh
Backups landen im aktuellen Verzeichnis. Log-Datei: wled_backup_<datum>.log. Das Backup-Datum wird in last_backup.txt im ISO-Format gespeichert.
Automatisierung (cron)
Täglich um 2:00 Uhr sichern:
crontab -e
Eintrag:
0 2 * * * /path/to/backup_wled.sh >> /path/to/backup_wled_cron.log 2>&1
Oder stündlich:
0 * * * * /path/to/backup_wled.sh >> /path/to/backup_wled_cron.log 2>&1
Voraussetzungen
avahi-browse,avahi-resolve(Avahi-Tools)curl- Netzwerk-Zugriff auf die WLED-Instanzen
Wiederherstellung
# Presets zurückspielen
curl -X POST -H "Content-Type: application/json" -d @wled-<hostname>-presets.json http://<IP>/presets.json
# Konfiguration zurückspielen
curl -X POST -H "Content-Type: application/json" -d @wled-<hostname>-config.json http://<IP>/json