Get Virtualizor

Add Backup Plans

Backup plans enable you to create different VPS backup settings for different VPS on the same server(s). You can assign backup plans to individual VPS or to the entire VPS plan. You can also allow the endusers to initiate backup/restore of their VPS at their will in the backup plan. Use the Add Backup Plans API to create a backup plan on the Virtualizor panel. The API response will contain "done" as "1" on successful creation of the backup plan.

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

HTTP Request

https://hostname:4085/index.php?act=addbackup_plan

Parameters

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['type'] = 'LOCAL' ;
    $post['plan_name'] = 'api backup' ;
    $post['id'] = 1 ;
    $post['dir'] = '/tmp/api_backup/' ;
    $post['freq'] = 'hourly' ;
    $post['hourly_freq'] = 1 ;
    $post['hrs'] = 0 ;
    $post['min'] = 0 ;
    $post['day'] = 1 ;
    $post['date'] = 1 ;
    $post['rotation'] = 1 ;
    $post['backup_limit'] = 0 ;
    $post['restore_limit'] = 0 ;
    $post['nice'] = 0 ;
    $post['ionice_prio'] = 0 ;
    $post['ionice_class'] = 3 ;
    $post['compression'] = 1 ;

    $output = $admin->addbackupplan($post);

    print_r(json_encode($output));
?>

Output

{
    "title": "Add Backup Plan",
    "done": 343, //backup plan ID 
    "timenow": 1536952659,
    "time_taken": "0.213"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list