Last active
October 3, 2023 03:58
-
-
Save maxtacu/eeec5284a68da396520a8955ec529d0d to your computer and use it in GitHub Desktop.
Download latest Hubitat backup using API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Your hubitat IP | |
HUBITAT=1.2.3.4 | |
# Backup output path parameter. Default: "." current path where you execute the script. | |
BACKUP_PATH="${1:-.}" | |
# Get the name of the latest backup file | |
REMOTE_BACKUP=`curl -s "http://$HUBITAT:8081/api/backups" | jq -r '.backups[0].name'` | |
# Download backup | |
curl -s "http://$HUBITAT:8081/api/downloadBackup/$REMOTE_BACKUP" -o $BACKUP_PATH/backup.lzf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment