[Solved] We need a script to create a backup of all the files, database and email using third party Cpanel details in PHP


include "xmlapi.php";

$source_server_ip = "";
$cpanel_account = ""; // cPanel username
$cpanel_password = ''; // cPanel password 

//Credentials for FTP remote site
$ftphost = ""; // FTP host IP or domain name
$ftpacct = ""; // FTP account
$ftppass = ""; // FTP password
$email_notify = ''; // Email address for backup notification

$xmlapi = new xmlapi($source_server_ip);
$xmlapi->password_auth($cpanel_account,$cpanel_password);
$xmlapi->set_port('2083');

$api_args = array('passiveftp', $ftphost, $ftpacct, $ftppass,$email_notify,21,"https://stackoverflow.com/");

$xmlapi->set_output('json');
print $xmlapi->api1_query($cpanel_account,'Fileman','fullbackup',$api_args);

?>

The above code is working fine but only for the same server where this code is written

solved We need a script to create a backup of all the files, database and email using third party Cpanel details in PHP