Skip to end of metadata
Go to start of metadata

The following example demonstrates how to add a server, create a Disk Safe, and a policy.

A PHP file called SelfManaged.php can be found here:

  • for Windows: <installdir>\apisamples
  • for Linux: <installdir>/apisamples

Read more in Access example API functions.

Sequence of Automated Actions

The following steps can be accomplished by using this script:

  1. Add a server. The server is the server or PC you want to back up. Read more in Protected Machines.
  2. Create a Disk Safe. This is the storage location of the backed-up data. Read more in Disk Safes.
  3. Create a policy. This is the task which configures the backup. Read more in Policies.

How to Fulfill Appropriate Actions in the Server Backup User Interface

Below, you can find the steps to take in the program user interface in order to perform the same actions as the script. See the accompanying screen-shots illustrating the scripts for every step.



First Step

date_default_timezone_set('America/Chicago'); ########====CDP Server Configuration Start====######## #set CDP server host name $HOST="127.0.0.1"; #set CDP server to access API $PORT="9443"; #set CDP user $USER="admin"; #set CDP user password $PASS="admin"; ########====CDP Server Configuration End====########

Create a Backup Agent

########====Create Agent Start====######## ##Add all the basic properties to the agent object # Description of agent $agentObj->description = "agentDescription"; # Host name of the agent ( It can be an IP or name ) $agentObj->hostname = "127.0.0.1"; # port number on whcih the agent will connect to the CDP server $agentObj->portNumber = 1167; # Set the agent OS type (ex: LINUX or WINDOWS) see Java Doc for more details $agentObj->osType = "WINDOWS"; #set database addon to true if you have a database addon license and you want to backup a database $agentObj->databaseAddOnEnabled = true; try{ $agentClient = new soapclient("https://$HOST:$PORT/Agent?wsdl", array('login'=>"$USER", 'password'=>"$PASS", 'trace'=>1, 'cache_wsdl' => WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS) ); $createdAgent=$agentClient->createAgentWithObject(array('agent'=>$agentObj)); echo "Successfully executed created Agent\n"; } catch (SoapFault $exception) { echo "Failed to create agent \n"; echo $exception; exit(1); } ########====Create Agent End====########

1. Click Servers in the Main Menu. Server Backup Manager displays the Servers page.

2. In the Servers menu, click Add Server, as displayed in the following image.

SBM displays the Create New Agent window.

3. Define the following options:

  • Server Name. Type a name for the server. SBM displays this name in the Servers list.
  • Host Name/IP. Type the host name or IP address of the server.
  • Port Number. Type the number of the port through which you want to connect to the server, if different from the default value (1167).

4. Click Create.

5. Once SBM displays the message that you successfully added the server, click OK to close the window.

For more information about adding a server using the Server Backup Manager Web interface, see Add Protected Machines to Backup Manager.

Create a Disk Safe

########====Create DiskSafe Start====######## ##Add all the basic properties to the diskSafe object # description of the diskSafe $disksafe->description ="description"; # use the agent we have just created, $disksafe->agentID = $createdAgent->return->id; # Path where the diskSafe will be created. This path has to be an absolute path $disksafe->path = "C:\longAPIScript"; # type of compression required for the diskSafe. There are different types of compression levels. See "CompressionType" in Java Docs for more details. $disksafe->compressionType = "QUICKLZ"; # This property defines how the devices will added to the CDP server, See "DeviceBackupType" in Java Doc for more details $disksafe->deviceBackupType = "AUTO_ADD_DEVICES"; # set if partition tables should be replicated. This should be set to true if you plan to BMR $disksafe->backupPartitionTable = true; # set if unmounted devices should be replicated. This option is only recommend for windows with unmounted system partitions. This should be set to true if you plan to BMR $disksafe->backupUnmountedDevices = true; # set diskSafe attributes. See DiskSafeAttributes in Java Doc for more info $disksafe->diskSafeAttributeMap = array( array( "key" => "FILE_EXCLUDES_ENABLED", "value" => "true"), array( "key" => "ARCHIVING_ENABLED", "value" => "true"), array( "key" => "CONTROLPANELS_ENABLED", "value" => "true"), array( "key" => "REPLICATION_FREQUENCY_LIMIT", "value" => "NO_LIMIT"), # RECOVERY_POINT_LIMIT set the value to "-1" to disable recovery point limit array( "key" => "RECOVERY_POINT_LIMIT", "value" => "-1"), # ARCHIVE_POINT_LIMIT set the value to "-1" to disable archive point limit array( "key" => "ARCHIVE_POINT_LIMIT", "value" => "-1"), array( "key" => "QUOTA_TYPE", "value" => "NONE"), array( "key" => "SOFT_QUOTA_VALUE", "value" => "-1"), array( "key" => "HARD_QUOTA_VALUE", "value" => "-1") ); #Sample encryption parameters if they are needed. This is not a required filed /* $disksafe->diskSafeEncryptionType = "XTS_AES_256"; $disksafe->diskSafeEncryptionPassphrase = "This is the disk safe passphrase"; */ try{ $diskSafeClient = new soapclient("https://$HOST:$PORT/DiskSafe?wsdl", array('login'=>"$USER", 'password'=>"$PASS", 'trace'=>1, 'cache_wsdl' => WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS) ); $createdDiskSafe = $diskSafeClient->createDiskSafeWithObject(array('disksafe'=>$disksafe)); echo "Successfully executed created DiskSafe\n"; } catch (SoapFault $exception) { echo "Failed to create diskSafe \n"; echo $exception; exit(1); } ########====Create DiskSafe End====########

1. Click Disk Safes in the Main Menu. Server Backup Manager displays the Disk Safes page.

2. In the Disk Safes menu, click Create New Disk Safe, as displayed in the following image.

SBM displays the Disk Safe Best Practices window, as shown in the following image.

3. Read the available information, and then click OK to close the window. If you do not want to see this same message each time you create a new Disk Safe, check Display this tip next time before clicking OK to continue. SBM displays the Create New Disk Safe window.

4. Define the following options:

Settings Tab
  • Name. Type the name for the Disk Safe. SBM displays this name in the Disk Safe list.
  • Server. Select the name of the server on which the Disk Safe will exist.
  • Path. Location where the Disk Safe resides.
    You can also enable the following options in the corresponding check-boxes:
  • Automatically add new devices. Indicates whether you want to automatically add all available devices to the Disk Safe.
  • Protect Storage Configuration. Indicates whether you want to back up partition tables.
  • Backup Windows System Reserved and Unmounted Partitions. Indicates whether you want to back up a hidden Windows system partition.

Devices tab
  • Automatically add new devices. Indicates whether you want to automatically add all available devices to the Disk Safe. Clear this checkbox to select the devices you want to add to the Disk Safe. If you do not select this option, then SBM displays the message, "At least one device must be enabled for replication," when you attempt to save the Disk Safe. For more information about devices, see Access devices and Add devices.
  • Protect Storage Configuration. Indicates whether you want to back up partition tables.
  • Devices on Server pane. This pane provides you with information about devices that currently exist on the host server. Click Get Devices From Agent to view the list of devices on your Backup Agent server. For more information about devices, see Access devices.
  • Devices In Disk Safe pane. This pane provides you with information about devices that are currently assigned to the Disk Safe. For more information about devices, see Access devices.

Data Settings Tab
  • Compression Type. Select the compression level for the Disk Safe.
  • Encryption Type. Select the encryption type for the Disk Safe. If you choose to encrypt a Disk Safe, SBM prompts you to create a password. You must supply that password to browse files, browse control panel users, browse databases, and initiate a bare-metal restore. For more information about your Disk Safe encryption, see Manage Disk Safe encryption.

Limits tab

The Limits tab allows file excludes, recovery point archiving, and control panels that you want to enable or disable. You can define a limit for your replication, recovery points, and archive points.

Tip
When you assign a Disk Safe to a volume, all the volume limits are applied to that Disk Safe. for this reason, the Disk Safe limits should be at least as restrictive as the volume. For example, if a volume has a recovery point limit set to 100, the Disk Safe can only contain 100 recovery points or less.

Options
  • Allow File Excludes. This option is selected by default. Activates the File Excludes feature for the Disk Safe. If you check this option, then the system allows you to specify the files and folders that you do not want to back up during the replication policy. By default, SBM replicates all file and folders from the selected devices. For more information about excluding files and folders, see About exclusions and Exclude files and folders.
    You cannot activate this option if it is not activated for the volume to which the Disk Safe belongs.
  • Allow Recovery Point Archiving. This option is selected by default. Activates the Archiving feature for the Disk Safe. If you check this option, then the system allows you to create archives of your data on a specified hour, day, week, or month. If the option is enabled, then you can specify the Archive Point Limit under Data Retention. For more information about archiving, see Offsite Backup and Archival.
    You cannot activate this option if it is not activated for the volume to which the Disk Safe belongs.
  • Allow Control Panels. This option is selected by default. Activates the Control Panels feature for the Disk Safe. This option allows you to back up and restore hosting control panel user accounts. for more information about control panels, see Hosting control panels.
    Tip
    You cannot activate this option if it is not activated for the volume to which the Disk Safe belongs.
    Tip
    There is a system-wide option to enable the Hosting Control Panels feature (Configuration > Product features Enable Hosting Control Panels option under Hosting Control Panels). For more information about enabling the Hosting Control Panels feature, see [Enabling Hosting Control Panels Feature].
  • Allow Database Backups. This option is selected by default. This option allows you to back up and restore all databases available on the server. If clear, the SQL Server, Exchange, and MySQL tabs are disabled while creating a policy.
  • Replication Limit. This option defines the lowest replication frequency for that Disk Safe. For example, if you set the replication limit to weekly, then the policy assigned to that Disk Safe can only be weekly or higher (hourly and daily replications are restricted).
    Tip
    The Disk Safe Replication Limit must be within the limits of the Replication Limit of the volume to which the Disk Safe is assigned.


Data Retention
  • Recovery Point Limit. The maximum number of recovery points stored in the Disk Safe.
    Tip
    The Disk Safe Recovery Point Limit must be within the limits of the Recovery Point Limit of the volume to which the Disk Safe is assigned. 
  • Archive Point Limit. The maximum number of archive points stored in the Disk Safe.
    The Disk Safe Archive Point Limit must be within the limits of the Archive Point Limit of the volume to which the Disk Safe is assigned.
Quotas
  • Quota Type. Select the type of quota assigned to the Disk Safe. Quotas are set to limit the disk usage of the Disk Safe. The limit is set on the basis of space occupied by Disk Safes or the size of deltas.
  • Soft Quota. Select the value in bytes or in deltas. Soft Quota is a warning level that informs users that they are close to reaching their effective limit.
  • Hard Quota. Select the value in bytes or in deltas. Hard Quota allows resources to be occupied by data. If the Hard Quota is reached, then the system forbids generation of new recovery points. The replication is interrupted and fails.

5. Click Create.

6. Once SBM displays the message that you successfully created the Disk Safe, click OK to close the window.

For more information about creating Disk Safes using the Server Backup Manager Web interface, see Create Disk Safes.

Create a policy

########====Create Policy Start====######## ##Add all the basic properties to the policy object $policyObj->enabled = true; $policyObj->name = "nameOfPolicy"; $policyObj->description = "descriptionOfPolicy"; $policyObj->diskSafeID = $createdDiskSafe->return->id; $policyObj->replicationScheduleFrequencyType = "HOURLY"; $replScheFreqVals->startingMinute= 5; $policyObj->replicationScheduleFrequencyValues = $replScheFreqVals; $policyObj->mergeScheduleFrequencyType = "DAILY"; $mergScheFreqVals->startingMinute=1; $mergScheFreqVals->hoursOfDay=array("1"); $policyObj->mergeScheduleFrequencyValues = $mergScheFreqVals; $policyObj->recoveryPointLimit = 10; $policyObj->forceFullBlockScan = false; $policyObj->multiVolumeSnapshot = false; #sample databaseInstance $DatabaseInstance->enabled=true; $DatabaseInstance->dataBaseType="MYSQL"; $DatabaseInstance->name="Apitest"; $DatabaseInstance->description="newApiTest"; $DatabaseInstance->useAlternateHostname=false; $DatabaseInstance->username="root"; $DatabaseInstance->password="password"; $DatabaseInstance->useAlternateDataDirectory=false; $DatabaseInstance->useAlternateInstallDirectory=false; $DatabaseInstance->backupAllDatabases=true; $DatabaseInstance->advancedOptions=array(array( key => "DO_TABLE_STATS_OPTION", value => false)); $DatabaseInstance->hostName="localhost"; $DatabaseInstance->portNumber=3306; $DatabaseInstance->virtuozzoContainerID=1254; $DatabaseInstance1->enabled=true; $DatabaseInstance1->dataBaseType="MYSQL"; $DatabaseInstance1->name="Apitest1"; $DatabaseInstance1->description="newApiTest1"; $DatabaseInstance1->useAlternateHostname=false; $DatabaseInstance1->username="root"; $DatabaseInstance1->password="password"; $DatabaseInstance1->useAlternateDataDirectory=false; $DatabaseInstance1->useAlternateInstallDirectory=false; $DatabaseInstance1->backupAllDatabases=true; $DatabaseInstance1->advancedOptions=array(array( key => "DO_TABLE_STATS_OPTION", value => false)); $DatabaseInstance1->hostName="localhost"; $DatabaseInstance1->portNumber=3306; $DatabaseInstance1->virtuozzoContainerID=1254; $policyObj->databaseInstanceList=array($DatabaseInstance, $DatabaseInstance1); #sample controlPanelInstance $ControlPanelInstance->enabled=true; $ControlPanelInstance->controlPanelType="CPANEL"; $ControlPanelInstance->name="Apitest"; $ControlPanelInstance->description="newApiTest"; $ControlPanelInstance->virtuozzoContainerID=1254; $ControlPanelInstance->advancedOptions=array(); $ControlPanelInstance1->enabled=true; $ControlPanelInstance1->controlPanelType="PLESK"; $ControlPanelInstance1->name="Apitest1"; $ControlPanelInstance1->description="newApiTest1"; $ControlPanelInstance1->virtuozzoContainerID=1255; $ControlPanelInstance1->advancedOptions=array(); $ControlPanelInstance2->enabled=true; $ControlPanelInstance2->controlPanelType="VIRTUOZZO"; $ControlPanelInstance2->name="Apitest2"; $ControlPanelInstance2->description="newApiTest2"; $ControlPanelInstance2->advancedOptions=array(); $policyObj->controlPanelInstanceList=array($ControlPanelInstance, $ControlPanelInstance1, $ControlPanelInstance2); #Sample ArchiveSchedule $ArchiveScheduleInstance1->archiveScheduleType = "DAILY"; $ArchiveScheduleInstance1->retentionCount = 50; $DailyFrequencyValues->startingMinute=1; $DailyFrequencyValues->hoursOfDay=array("5"); $ArchiveScheduleInstance1->archiveScheduleFrequencyValues = $DailyFrequencyValues; $ArchiveScheduleInstance2->archiveScheduleType = "WEEKLY"; $ArchiveScheduleInstance2->retentionCount = 50; $WeeklyFrequencyValues->daysOfWeek=TUESDAY; $WeeklyFrequencyValues->startingHour=array(1, 5); $WeeklyFrequencyValues->startingMinute = 10; $ArchiveScheduleInstance2->archiveScheduleFrequencyValues = $WeeklyFrequencyValues; $ArchiveScheduleInstance3->archiveScheduleType = "MONTHLY"; $ArchiveScheduleInstance3->retentionCount = 50; $MonthlyFrequencyValues->daysOfMonth = 3; $MonthlyFrequencyValues->startingHour = 3; $MonthlyFrequencyValues->startingMinute = 20; $ArchiveScheduleInstance3->archiveScheduleFrequencyValues = $MonthlyFrequencyValues; $policyObj->archiveScheduleInstanceList=array($ArchiveScheduleInstance1, $ArchiveScheduleInstance2, $ArchiveScheduleInstance3); try{ $policyClient = new soapclient("https://$HOST:$PORT/Policy2?wsdl", array( 'login'=>"$USER", 'password'=>"$PASS", 'cache_wsdl' => WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'trace'=>1 ) ); $createdPolicy = $policyClient->createPolicy(array('policy'=>$policyObj)); echo "Successfully executed created Policy\n"; } catch (SoapFault $exception) { echo "Failed to create policy \n"; echo $exception; exit(1); } ########====Create Policy End====########

1. Click Policy in the Main Menu. Server Backup Manager displays the Policies window.

2. In the Policy menu, click Create New Policy.

SBM displays the Create New Policy window.

3. Define the following options:

  • Enabled. Indicates whether you want to enable the policy. The enabled policy runs according to the schedule.
  • Name. Type the name you want use to identify this policy among others in the Policies list.
  • Description. Type the details of your policy.
  • Server. Select a server whose data you are going to replicate. You then can select a Disk Safe assigned to the server.
  • Disk Safe. Select a Disk Safe in which to save the replicated data.

4. Click "Edit Schedule" to edit the replication schedule.

Choose "Hourly" as the Replication Frequency and "5" as the Starting Minute.

Click "OK."

5. Click "Edit Schedule" to edit the merge schedule.

Define "Daily" as the Merge Frequency and "1" as the Starting Minute.

Click "OK."

6. Click "Create".

7. Click "OK" in the "Success" window.

See Create policies.

Labels:
api api Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.