Commvault End-User Command Line (cvc) Interface Example: restore

Name

restore

Synopsis

  • restore [path]

    Performs an in-place restore operation with default options.

  • restore [-h] [-c CLIENTNAME] [-i INSTANCENAME] [-bk BACKUPSETNAME] [-sc SUBCLIENTNAME]([-path SOURCEPATH [SOURCEPATH ...] | -l RESTOREFILELIST | -list])[-dc DESTCLIENT] [-dp DESTPATH] [-ftime FROMTIME] [-ttime TOTIME] [-allVersions] [-versions VERSIONS] [-uo UNCONDITIONALOVERWRITE {True,False}] [-filter BROWSE_FILTER [BROWSE_FILTER ...]]

Description

Restore the backup.

You can perform the following restore types:

  • In-Place

  • Out-of-Place

  • Point-in-Time

If you want to perform a point-in-time restore, then you must use one of the following options:

  • The from time (the start time of the window during which the data was backed up)

  • The to time (the end time of the window during which the data was backed up)

  • The from and to time (the window during which the data was backed up)

Note

If you do not specify the backup set and the subclient, then the software performs the browse operation on the default backup set.

The table lists the options that the software supports.

Option

Description

-c

The CommCell Console client name.

The software uses the information that is in the computer registry when you do not specify this option.

-i

The CommCell Console instance name.

-bk

The CommCell Console backup set name.

The software uses the DefaultBackupSet when you do not specify this option.

-sc

The CommCell Console subclient name.

The software uses the DefaultBackupSet and the default subclient when you do not specify this option.

-path

The path on the source that contains the data that you want to restore.

You can specify relative paths.

-l

The list of files that you want to restore.

-dc

This is the destination client name. You must use this option, or the -dp option when you perform an out-of-place restore operation.

-dp

This is the path on the destination client where you want to restore the data. You must use this option or the -dc option when you perform an out-of-place restore operation.

-ftime

The start time of the backup window that you specify for a point-in-time restore operation. The format is yyyy-mm-dd hh:mm:ss.

-ttime

The end time of the backup window that you specify for a point-in-time restore operation. The format is yyyy-mm-dd hh:mm:ss.

-uo

Configure the software to automatically overwrite the data on the destination. Valid values are:

  • True

  • False

-allVersions

Browse all versions of a file within a backup cycle.

Note

This option is supported only for files. Directories are not supported.

-versions

Restore all the versions, or a specific version. The software restores the latest version by default. To restore a specific version, set this to the backup versions number that you want to restore, for example, "1".

-list

Dynamic list for the restore operation.

-filter

File name filters for the restore operation.

-h

Displays the help for this command.

Examples

Perform an In-Place Restore of a Path with Default Options

If you use path as a positional argument, the software overrides the user-provided values for options and performs an in-place restore operation with default values.

cvc> restore /tmp/test 
Restore Job Initiated successfully 
<?xml version="1.0" ?> 
<Task>   <JobID>589121</JobID> 
</Task> 
Restore Initiated Successfully Job ID : 589121

Perform an Out-of-Place Restore Operation to a New Folder

The following command performs an out-of-place restore operation. The data is restored to a new path on the source client. In this example, the parameters are listed on the command line.

cvc> restore -c example_client -sc good -path "C:\Users\admin\Desktop\good2" -dc example_client -dp "C:\Users\admin\Desktop\logs" -ftime "2017-09-23 08:00:00" 
Restore Job Initiated successfully 
<?xml version="1.0" ?> 
<Task>   <JobID>589132</JobID> 
</Task> 
Restore Initiated Successfully Job ID : 589132

Perform an Out-of-Place Restore Operation to a New Client

The following command performs an out-of-place restore operation. The data is restored to a new client. In this example, the parameters are listed on the command line.

cvc> restore -c example_client -sc good -path "/tmp/test" -dc example_client_latest -dp "/tmp/test/new"
Restore Job Initiated successfully 
<?xml version="1.0" ?> 
<Task>   <JobID>595584</JobID> 
</Task> 
Restore Initiated Successfully Job ID : 595584

Perform a Restore Operation That Overwrites the Data on the Destination

The following command overwrites the data at the destination. In this example, the parameters are listed on the command line.

cvc> restore -c example_client -sc good -path "/tmp/test" -outplace True -dc example_client_latest -dp "/tmp/test/new" -uo True
Restore Job Initiated successfully 
<?xml version="1.0" ?> 
<Task>   <JobID>595583</JobID> 
</Task> 
Restore Initiated Successfully Job ID : 595583

Perform a Restore Operation from a List

The following command creates a restore list, and then performs a restore operation from the list. In this example, the parameters are listed on the command line.

cvc > restore_list
cvc > add /testdata/Dir_0_705/Dir_1_705
cvc > add /tmp/restore
cvc > list
Restore list: {'/testdata/Dir_0_705/Dir_1_705', '/tmp/restore'}
cvc > restore -list -dp /tmp
<TMMsg_CreateTaskResp taskId="4325">
  <jobIds val="34417"/>
</TMMsg_CreateTaskResp>

Loading...