Get Virtualizor

Create Single VPS Backup

Use the Create Single VPS Backup API to create the backup of the VPS. This is the image of the VPS which can be stored locally or remotely depending on the backup plan given to the VPS. The log file for the backup process can be found at /var/virtualizor/log/backup/VPSID.log. The API response will contain "done" message after the backup process is started successfully (Since 3.0.8.2+).

For more information, you can refer this Backup Plans guide.

HTTP Request

https://hostname:4085/index.php?act=act=managevps&cbackup=1&vpsid=VPSID

Parameters

NameMethodValueDescriptionRequired
actGET managevps The action will return done message after the backup is started.Yes
cbackup GET1The value should be set to one for taking backup of the VPS.Yes
vpsidPOSTIntThe vpsid of VPSYes

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);

    $vpsid = 3;

    $output = $admin->create_single_vps_backup($vpsid);

    print_r(json_encode($output));
?>

Output

{
    "title": "Manage VPS",
    "done": {"msg":"The VPS backup was started successfully"},
    "actid":"31794",
    "timenow": 1537290773,
    "time_taken": "0.269"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list