You are correct. I pasted the wrong script!
For reboot:
Replace:
curl -k -sb $cookiefile https://$he_ipaddr/hub/backupDB?fileName=latest -o $backupfile
with
curl -k -sb $cookiefile -X POST https://$he_ipaddr/hub/reboot
And delete
backupdir=/opt/hubitat/hubitat-backup/hubitat
backupfile=$backupdir1/$(date +%Y%m%d-%H%M).lzf
#
find $backupdir/*.lzf -mtime +5 -exec rm {} \;