Automatic download backups for Hubitat

The script backups look to be valid or at least the sizes match the backups stored within my Hubitat device.

I've generally kept my hub very current with updates. On my hub the backups have been about 2000KB until 8/16/2010. Since 8/17/2020 all my backups are about 560KB.

Perhaps the compression used for the backup has changed.

The number of events stored per device has been truncated substantially.

2 Likes

I've updated the script to 1.0.2 which fixes retrieval of the hubitat version so it is included in the backup file name.

1 Like

My native hubitat backups are 2MB, but the script generates file of just 12KB. Wonder if it has anything to do with the C7 being on a different VLAN than the server running the script. Any idea what port needs to be opened?

TOO MANY FIREWALL RULES!

I only have a C5. I wonder if the HTML is different for the C7. If someone doesn't mind sending me privately a .zip of the Settings web page I should be able to test this out. In Chrome it would be Save-As and then "Webpage, Complete".

The same backup command works on the C7. When I goto the backup link, the backup downloads correctly. Is that the info you were looking for? Or should I still send the html?

Thanks for the script! I didn’t know I wanted to do this till I stumbled across this thread. Kicking it off nightly with Task Scheduler, saving to DrivePool and sending to Google Drive with Rclone. :+1:

It sounds like it is working for C7. The real confirmation would be to perform a restore of a backup.

Ok, receiving an error now. Any help with this will be appreciated. Seems like it's failing at getting the version

So then it may be helpful for me to get the C7 Settings HTML page for testing.

PM'd you the html. Appreciate your help on this

I have my scripts running on a windows machine.. with a scheduled task.. it uses curl..
here is the script if you would like to use it.. my hubs are password protected .. so you have to update the script with your username and password and IP address of hub. and Also update the path of curl. ( after downloading it from the web )

here is the script... I have copied row 17 -20 for extra hubs, and updated for their IP addresses.
**** download_backups.vbs****

Set args = WScript.Arguments

Set WshShell = WScript.CreateObject("WScript.Shell")

Dim exeName
Dim statusCode

curl_path="C:\curl\curl-7.72.0-win64-mingw\bin"
my_download_path="Y:\Hubitat\Backups"
my_date = DatePart("yyyy",now()) & lpad(DatePart("m",now()),"0",2) & lpad(DatePart("d",now()),"0",2) & "_" & lpad(hour(now()),"0",2) & lpad(minute(now()),"0",2) & lpad(second(now()),"0",2)

exeName = curl_path & "curl.exe -c cookie.txt -d ""username=YOUR_USERNAME"" -d ""password=YOUR_PASSWORD"" http://IP_ADDRESS_OF_HUB/login"
statusCode = WshShell.Run (exeName, 1, true)
my_save_file=my_download_path & "Hubitat_" & my_date & ".lzf"
exeName = curl_path & "curl.exe -sb cookie.txt http://IP_ADDRESS_OF_HUB/hub/backupDB?fileName=latest -o """ & my_save_file & """"
statusCode = WshShell.Run (exeName, 1, true)

Function LPad (str, pad, length)
LPad = String(length - Len(str), pad) & str
End Function

1 Like