• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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