• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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