Endpoint to download latest backup programmatically

Hi All,

I've got something that works to download the latest backup programmatically (I run on a raspi daily and store the file on my NAS), but I have to adjust it each time there's a new firmware as the code gets tweaked.

Here's what it currently looks like:

curl http://10.0.6.4/hub/backup | grep data-fileName | grep download | sed 's/<a class=\"download mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect\" href=\"#\" data-fileName=\"//' | sed 's/\">Download<\/a>//' | sed 's/ //g' | tail -1 | xargs -I @ curl -o @ http://10.0.6.4/hub/backupDB?fileName=@

Could we just get a simple endpoint URL that just returns the latest backup? Would save me (and I'm sure a few others) some headaches.

Thanks!

here is mine for qnap nas.. dont have to adjust anything.

C:\hubitat>cat *.sh
#!/bin/sh

cd /share/qnapshared/hubitat
/usr/bin/wget http://192.168.11.109/hub/backupDB?fileName=latest --backups=7
/bin/cp backupDB?fileName=latest hubitat_$(date +%Y%m%d).lzf

C:\hubitat>

1 Like

well crap, that's a heck of a lot easier. works for me if that filename=latest endpoint stays consistent.

Doesn't capture the version number, but not sure that's a huge deal. Okay, gonna give this a go.

Thank you!

ya thats the downfall but as long as you know what version you were on for a given date .. no bigee.

1 Like