Curl backup script not working? [SOLVED]

Here's the original. You should remove the quotation marks.

#!/bin/bash
#
he_login=your_he_login
he_passwd=your_he_passwd
he_ipaddr=your_he_ip_addr
cookiefile=`/bin/mktemp`
backupdir=/opt/hubitat/hubitat-backup
backupfile=$backupdir/$(date +%Y%m%d-%H%M).lzf
#
find $backupdir/*.lzf -mtime +5 -exec rm {} \;
curl -k -c $cookiefile -d username=$he_login -d password=$he_passwd https://$he_ipaddr/login
curl -k -sb $cookiefile https://$he_ipaddr/hub/backupDB?fileName=latest -o $backupfile
rm $cookiefile
1 Like