The script is using cPanel uapi which bypasses resource limits. It makes a full cPanel backup and transfers it to a remote server using SCP. If the backup fails, you will get an error message from cron. Replace the configs written in CAPITALS before running the script.
Code: Select all
#!/bin/sh
_remotedir="REMOTE_SCP_SERVER_DIRECTORY_FOR_BACKUPS"
_host="REMOTE_SCP_SERVER_NAME"
_username="USERNAME"
_password="PASSWORD"
_response=$(uapi Backup fullbackup_to_scp_with_password host="$_host" port=22 username="$_username" password="$_password" directory="~%2F$_remotedir" 2> /dev/null)
error_response="status: 0"
if test "${_response#*$error_response}" != "$_response"; then
echo "Error in running: $_response"
exit 1
fi
Happy hacking,
Santeri