Open Ramalama2 opened 1 year ago
Since i found it a bit stupid to use an 5.8mb executable for that task, ill did it with a simple bash script: https://github.com/Ramalama2/wled-backup-script
Cheers
GitHub
Simple script to Automate Wled Backups. Contribute to Ramalama2/wled-backup-script development by creating an account on GitHub.
If you backup multiple wled instances, your executable dumps always the last instance:
# ./scripts/wled-backup_linux_x64 export --hosts=wled-zimmer.user.mydomain.eu,wled-buero.user.mydomain.eu --outputDir=/root/Backups/WLED
Output:
Written Files:
As you see it dumps wled-buero, as wled-zimmer.
It doesn't matter if i use the IP or Hostname.
Workaroud Script
Backup_DIR=/root/Backups/WLED wled_backup_exec=/root/scripts/wled-backup_linux_x64 currtime=$(TZ="Europe/Berlin" date +"%Y%m%d-%H%M")
Array of hosts
hosts=("wled-buero.user.mydomain.eu" "wled-zimmer.user.mydomain.eu")
Loop over each host
for host in "${hosts[@]}"; do
Extract the host name from the full address
host_name=$(echo "$host" | cut -d'.' -f1)
Execute the backup
$wled_backup_exec export --hosts="$host" --outputDir="$Backup_DIR"
Rename the configuration and presets files
mv "$Backup_DIR/$host_name.config.json" "$BackupDIR/${currtime}$host_name.config.json" mv "$Backup_DIR/$host_name.presets.json" "$BackupDIR/${currtime}$host_name.presets.json" done