Hello,
I got a problem with backup on an external FTP server via XML-RPC.
Here's my PHP code.
And there's the result ...
Settings seem to be OK ...
Somebody could help me ?
I got a problem with backup on an external FTP server via XML-RPC.
Here's my PHP code.
$curl = $plesk->curlInit($server, $plesk->login, $plesk->password);
$xml_request = '<packet version="' . $plesk->version . '">
<backup-manager>
<set-remote-storage-settings>
<domain-id>' . $domain_id . '</domain-id>
<settings>
<protocol>ftp</protocol>
<host>ftp.test.fr</host>
<port>21</port>
<directory> </directory>
<login>' . $user_ftp . '</login>
<password>' . $pass_ftp . '</password>
<passive-mode>false</passive-mode>
</settings>
</set-remote-storage-settings>
</backup-manager>
</packet>';
$response = $plesk->sendRequest($curl, $xml_request);
$responseXml = $plesk->parseResponse($response);
var_dump($responseXml);
$curl = $plesk->curlInit($server, $plesk->login, $plesk->password);
$xml_request = '<packet version="' . $plesk->version . '">
<backup-manager>
<get-remote-storage-settings>
<domain-id>' . $domain_id . '</domain-id>
<protocol>ftp</protocol>
</get-remote-storage-settings>
</backup-manager>
</packet>';
$response = $plesk->sendRequest($curl, $xml_request);
$responseXml = $plesk->parseResponse($response);
var_dump($responseXml);
echo "Do the backup :";
$curl = $plesk->curlInit($server, $plesk->login, $plesk->password);
$xml_request = '<packet version="' . $plesk->version . '">
<backup-manager>
<backup-domain>
<domain-id>' . $domain_id . '</domain-id>
<remote/>
<description>Via API XML-RPC</description>
<split-size>0</split-size>
<only-hosting/>
<only-configuration />
</backup-domain>
</backup-manager>
</packet>';
$response = $plesk->sendRequest($curl, $xml_request);
$responseXml = $plesk->parseResponse($response);
var_dump($responseXml);
And there's the result ...
object(SimpleXMLElement)[22]
public '@attributes' =>
array
'version' => string '1.6.0.2' (length=7)
public 'backup-manager' =>
object(SimpleXMLElement)[15]
public 'set-remote-storage-settings' =>
object(SimpleXMLElement)[14]
public 'result' =>
object(SimpleXMLElement)[18]
public 'status' => string 'ok' (length=2)
Object(SimpleXMLElement)[19]
public '@attributes' =>
array
'version' => string '1.6.0.2' (length=7)
public 'backup-manager' =>
object(SimpleXMLElement)[22]
public 'get-remote-storage-settings' =>
object(SimpleXMLElement)[15]
public 'result' =>
object(SimpleXMLElement)[14]
public 'status' => string 'ok' (length=2)
public 'settings' =>
object(SimpleXMLElement)[18]
public 'protocol' => string 'ftp' (length=3)
public 'host' => string 'ftp.test.fr' (length=12)
public 'port' => string '21' (length=2)
public 'directory' =>
object(SimpleXMLElement)[20]
public 'login' => string 'mylogin' (length=5)
public 'password' => string 'mypassword' (length=8)
public 'passive-mode' => string 'false' (length=5)
Do the backup :
object(SimpleXMLElement)[21]
public '@attributes' =>
array
'version' => string '1.6.0.2' (length=7)
public 'backup-manager' =>
object(SimpleXMLElement)[19]
public 'backup-domain' =>
object(SimpleXMLElement)[22]
public 'result' =>
object(SimpleXMLElement)[15]
public 'status' => string 'error' (length=5)
public 'errcode' => string '15100' (length=5)
public 'errtext' => string 'The protocol is not supported by Plesk.' (length=40)
Settings seem to be OK ...
Somebody could help me ?