Backup + Skript für wled
Find a file
Florz 37fb676a4e KI-Halluzinationen entfernt
Der Code wurde laut Rob komplett von Claude erstellt.
2026-03-19 11:59:44 +01:00
backup_wled.sh init 2026-03-17 21:08:38 +01:00
last_backup.txt mu 2026-03-17 21:22:40 +01:00
README.md KI-Halluzinationen entfernt 2026-03-19 11:59:44 +01:00
wled-wled-chchsign-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-chchsign-presets.json init 2026-03-17 21:08:38 +01:00
wled-wled-doppelstreifen-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-doppelstreifen-presets.json init 2026-03-17 21:08:38 +01:00
wled-wled-matrix-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-matrix-presets.json init 2026-03-17 21:08:38 +01:00
wled-wled-matrix450-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-matrix450-presets.json init 2026-03-17 21:08:38 +01:00
wled-wled-ringtest-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-ringtest-presets.json init 2026-03-17 21:08:38 +01:00
wled-wled-stripe-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-stripe-presets.json init 2026-03-17 21:08:38 +01:00
wled-wled-text-config.json mu 2026-03-17 21:22:40 +01:00
wled-wled-text-presets.json init 2026-03-17 21:08:38 +01:00
wled_backup_20260317_210154.log init 2026-03-17 21:08:38 +01:00
wled_backup_20260317_210753.log init 2026-03-17 21:08:38 +01:00
wled_backup_20260317_212145.log mu 2026-03-17 21:22:40 +01:00

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