Fileman::fullbackup
Hi,
i created a script using the cpanel API v1 Fileman::fullbackup,
[PHP]$source_server_ip = "blah"; // Server IP or domain name eg: 212.122.3.77 or cpanel.domain.tld
$cpanel_account = "blah"; // cPanel username
$cpanel_password = "blah"; // cPanel password
$cpanel_port = '2083';
$ftphost = "blah"; // FTP host IP or domain name
$ftpacct = "blah"; // FTP account
$ftppass = "blah"; // FTP password
$ftpport = '21';
$ftpdirectory = '/blah';
$email_notify = 'blah@blah.com'; // Email address for backup notification
### DO NOT EDIT BELOW ###
set_time_limit(0);
$basePath = dirname(dirname(__FILE__));
require_once $basePath . "/library/xmlapi-php-master/xmlapi.php";
$xmlapi = new xmlapi($source_server_ip);
$xmlapi->password_auth($cpanel_account,$cpanel_password);
$xmlapi->set_port($cpanel_port);
$xmlapi->set_debug(1);
$api_args = array(
'passiveftp',
$ftphost,
$ftpacct,
$ftppass,
$email_notify,
$ftpport,
$ftpdirectory
);
$xmlapi->set_output('json');
print $xmlapi->api1_query($cpanel_account, 'Fileman', 'fullbackup', $api_args);[/PHP]
it returns
{"apiversion":"1","type":"event","module":"Fileman","func":"fullbackup","source":"module","data":{"result":""},"event":{"result":1}}
how can i know if its creating a backup? Is there any directory that will create the backup temporarily on the server before it transfer via FTP?
TIA,
Mike
-
Hi, it seems to the home/$user directory. TIA 0 -
Hello :) Yes, for the cPanel backup option, the archive is stored in /home/$username before the FTP transfer. Thank you. 0 -
Ok, but when you are requesting remotely, besides waiting, how does the json data returned tells it all went right or not ??? I've issued plenty of this fullbackup requests remotely, obtaining this result : Result:: {"apiversion":"1","type":"event","module":"Fileman","func":"fullbackup","source":"module","data":{"result":""},"event":{"result":1}} And no backup at all was really done neither FTP pushed of course :( 0
Please sign in to leave a comment.
Comments
3 comments