• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question CLI API

zooloo

New Pleskian
Server operating system version
AlmaLinux 9.3
Plesk version and microupdate number
Version 18.0.60 Update #1, last updated on April 25, 2024 03:15 AM
Good afternoon
Please tell me the correct JSON example for recovery via api cli

how to specify the correct path and command?

-d '{"params": [
"--get","clients"],"env": {"in": "/var/lib/psa/dumps/clients/uesrname/backup_info_2404200000_2404250000.xml"}}'

thx
 
The CLI method for the Rest API is based on the Plesk CLI. The documentation for the pleskrestore CLI utility can be found here and lists all commands and options.

You can try this payload body for example:
Code:
{
  "params": [
    "--restore",
    "/var/lib/psa/dumps/clients/uesrname/backup_info_2404200000_2404250000.xml",
    "-level",
    "clients"
  ]
}

Or if you have secured the backups with a password you can specify the password using the PLESK_BACKUP_PASSWORD environment variable. For example:
Code:
{
  "params": [
    "--restore",
    "/var/lib/psa/dumps/clients/uesrname/backup_info_2404200000_2404250000.xml",
    "-level",
    "clients"
  ],
  "env": {
    "PLESK_BACKUP_PASSWORD": "<password goed here>"
  }
}
 
Last edited:
Thx
Is there a comma before level?

Another question is how to get a list of backups for customers
 
Another question is how to get a list of backups for customers
Good one. I don't think there is an method available to list backups. Best I can think of to create your own script which reads trough the /var/lib/psa/dumps/clients/uesrname/ directory and looks for XML files.
 
Back
Top