Use the Delete Database Backup API to delete the backed up files of the database. The API response will contain "done" as an array consisting of keys "delete" as "true" after the backed up files are deleted successfully.
HTTP Request
https://hostname:4085/index.php?act=databackup
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | databackup | The action will delete a specified backup file | Yes |
id | POST | text | The name of the backup file. For multiple files you can pass comma separated values of the filenames | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$post = array();
$post['id'] = '20160529.sql';
$output = $admin->databackup($post);
print_r(json_encode($output));
?>
Output
{
"title": "Database Backup",
"done": {
"delete": true,
"db_no_avi": true
},
"backup_servers": {
"1": {
"bid": "1",
"name": "slate_doc_server",
"type": "SSH"
}
},
"timenow": 1536259307,
"time_taken": "0.201"
}