- Plesk for Linux
It is needed to create customer-level backup task.
How can it be done?
The following request packet creates a backup task which instructs Plesk to perform a customer-level backup (without splitting) of the customer account with ID 18:
1. Login to the server over SSH
2. Create an XML file, for example, request.xml:
<description>Standard weekly backup</description>
3. Use the following command to make a request:
# curl -kLi -H "Content-Type: text/xml" -H "HTTP_AUTH_LOGIN: admin" -H 'HTTP_AUTH_PASSWD: *********' -H "HTTP_PRETTY_PRINT: TRUE" -d @request.xml https://203.0.113.2:8443/enterprise/control/agent.php
Note: wrapping up the XML requests into scripts that are later called via HTTP is not recommended. The reasons are:
- requests via Plesk API are more stable, it isn't affected by operations which require Apache/Nginx/FPM restart (i.e., site creation, updating of hosting settings, daily maintenance operations and so on)
- security: malicious client can flood the server with HTTP requests to the PHP script causing the server downtime. API requests are executed only from authorized clients.