#cPanel info
CP_USERNAME=username
CP_PASSWORD=password
CP_DOMAIN=yourdomain.com
CP_SKIN=x3 #plain "x" is probably the most used one

#SCP/FTP info
CP_SCP_USER=username
CP_SCP_PASS=password
CP_SCP_HOST=yourhost.com
CP_SCP_MODE=scp #see cPanel backup page for alternatives
#CP_SCP_PORT=65321 #if you have a non-standard port

#if you want to put the backups somewhere smart,
#remove comment from the CP_SCP_RDIR line and
#make sure the directory exists
#CP_SCP_RDIR=web_backup%2F$CP_DOMAIN%2F # url encoded, e.g. "/" equals "%2F"

CP_EMAIL=email@example.com

#make sure this command (starting with curl, ending with dev/null) is on one line
curl --silent --insecure --user $CP_USERNAME:$CP_PASSWORD -d "dest=$CP_SCP_MODE&email=$CP_EMAIL&server=$CP_SCP_HOST&user=$CP_SCP_USER&pass=$CP_SCP_PASS&port=$CP_SCP_PORT&rdir=$CP_SCP_RDIR" https://$CP_DOMAIN:2083/frontend/$CP_SKIN/backup/dofullbackup.html > /dev/null

CURL_EXIT=$?

if [ $CURL_EXIT -gt 0 ]; then
  echo curl returned exit status $CURL_EXIT - see curl manual pages for more details
  exit 69
fi

# ok
exit 0
