Ok, I got the 2 files and did a Frankenstein
#!/bin/bash
#
he_login=hubitat_login
he_passwd=hubitat_password
#
he_ipaddr=hubitat_ip_address
cookiefile=`/bin/mktemp`
#
curl -k -c $cookiefile -d username=$he_login -d password=$he_passwd https://$he_ipaddr/login
curl -k -sb $cookiefile -X POST https://$he_ipaddr/hub/reboot
#!/bin/bash
# Script to download hubitat backup
cd [DIRECTORY_OF_YOUR_BACKUPS]
ls -1tr | head -n -3 | xargs -d '\n' rm -f --
curl http://[HUBIPHERE]/hub/backup | grep data-fileName | grep download | sed 's/<td class=\"mdl-data-table__cell--non-numeric\"><a class=\"download mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect\" href=\"#\" data-fileName=\"/\ /' | sed 's/\">Download<\/a><\/td>/\ /' | sed 's/ //g' | tail -1 | xargs -I @ curl -o @ http://[HUBIPHERE]/hub/backupDB?fileName=@
The Frankenstein:
#!/bin/bash
#
cd [DIRECTORY_OF_YOUR_BACKUPS]
he_login=hubitat_login
he_passwd=hubitat_password
#
he_ipaddr=hubitat_ip_address
cookiefile=`/bin/mktemp`
#
curl -k -c $cookiefile -d username=$he_login -d password=$he_passwd https://$he_ipaddr/login
curl -k -sb $cookiefile -X POST https://$he_ipaddr/hub/backup | grep data-fileName | grep download | sed 's/<td class=\"mdl-data-table__cell--non-numeric\"><a class=\"download mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect\" href=\"#\" data-fileName=\"/\ /' | sed 's/\">Download<\/a><\/td>/\ /' | sed 's/ //g' | tail -1 | xargs -I @ curl -o @ http://$he_ipaddr/hub/backupDB?fileName=@
Can anyone check if this is correct? I have no clue on this, actually I'm using crontab -e and I don't see the timing in the scrip, probably I can use something else, but I have no clue.
Thanks @dan.t & @csteele and @aaiyar & @ryan780 for the scrips