Examples of Command Line Interface

This section illustrates some common uses of the Command Line Interface.

Example 1: BACK UP DATA

The following backup define command uses the -c argument not only to start the command line interface but to define and run a backup job called "job1" in a single step. The backup job "job1" uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "backup define -n job1 -t backup_base 
-f cmdfile -run"

The following is the "cmdfile" definition file used by the previous command.

Command Type

Command

OPTIONSBACKUP

"EOJ_ACTION U; RETENTION 30; VERIFYLEVEL 2;" ; NODE (node1 UNIX) SELECT (I "/vol1/*") MEDIAPOOL pool1 DEVICECLUSTER cluster1 ;

Example 2: BACK UP CATALOG

The following backup define command uses the -c argument not only to start the command line interface but to define a backup job called "job1" in a single step. The backup job "job1" backs up the Catalog and uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "backup define -n job1 
-t backup_catalog -f cmdfile"

The following is the "cmdfile" definition file used by the previous command.

Command Type

Command

OPTIONSBACKUP

"ORIGTAPEOFFSITE Y; EOJ_ACTION U; VERIFYLEVEL 3; CHECKSUM Y;" ; CATALOG MEDIAPOOL pool1 DEVICECLUSTER cluster1 ;

Example 3: RUN BACKUP

The following backup run command uses the -c argument not only to start the command line interface but to run the backup job "job1" defined in Example 2 in a single step.

BEX -s node1 -u sysadmin -p syspass -c "backup run 
-n job1 -t backup_catalog"

Example 4: BACK UP IMAGE

The following backup define command uses the -run argument to define and run the backup job "job1," which backs up image data from filer "node1" to "/vol1/" and uses the definition file "cmdfile."

BEX -c "backup define -n job1 -t backup\_image\_incr 
-f cmdfile -run -replace"

The following is the "cmdfile" definition file used by the previous command.

Command Type

Command

OPTIONSBACKUP

"NDMP_ENV <>; NDMP_FH L; NDMP_LOG Y;" ; NODE (node1 UNIX) SELECT (I "/vol1/*") MEDIAPOOL pool1 DEVICECLUSTER cluster1 ;

Example 5: BACK UP NDMP DATA

The following backup define command uses the -run argument to define and run the backup job "job1," which backs up NDMP data from filer "node1" to "/vol1/" and uses the definition file "cmdfile."

BEX -c "backup define -n job1 -t backup_ads 
-f cmdfile -run -replace"

The following is the "cmdfile" definition file used by the previous command.

Command Type

Command

BACKUP

NODE (node1 NDMP) SELECT (I "/vol1/*") MEDIAPOOL pool1 DEVICECLUSTER cluster1 ;

Example 6: BACK UP SNAPVAULT

The following backup define command uses the -run argument to define and run the backup job "job1," which backs up SnapVault data from filer "node1" to "/vol1/" and uses the definition file "cmdfile."

BEX -c "backup define -n job1 -t backup_snapvault 
-f cmdfile -run -replace"

The following is the "cmdfile" definition file used by the previous command.

Command Type

Command

BACKUP

NODE (node1 UNIX) SELECT (I "/vol1/") SNAPDEVICE "NStor1:/vol1/" ;

Example 7: RESTORING FROM CATALOG

The following restore define command uses the -c argument not only to start the command line interface but to define a restore job called "job1" in a single step. The restore job "job1" restores a file called "file1," using the Catalog to find the tape that contains the file, and uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "restore define 
-n job1 -t restore -f cmdfile"

The following is the "cmdfile" definition file used by the previous command. The SELECT statement is used to restore the specific file. The file is restored to its original location on the "node1" node. The job is deleted upon its successful completion.

Command Type

Command

OPTIONSRESTORE

"REMOVENONBACKUPJOBS Y;" ; NODE (node1 UNIX) SELECT (I "/file1") FROM CATALOG ;

Example 8: RESTORING FROM CATALOG

The following restore define command uses the -run argument to define and initiate a restore job that restores all the files in the directory "/vol1/." The restore job "job1" uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "restore define 
-n job1 -t restore -f cmdfile -run"

The following is the "cmdfile" definition file used by the previous command. It restores files from a specific time period to a new location. The job is deleted upon its successful completion.

Command Type

Command

OPTIONSRESTORE

"REMOVENONBACKUPJOBS Y;" ; NODE (node1 UNIX) SELECT (I "/vol1/*") TO NODE (node1 UNIX) PATH "/vol2/" FROM CATALOG DATE (01/01/00 1/01/01) ;

Example 9: RESTORING FROM CATALOG

The following restore run command restores all files from directory "/vol1/" on the "node1" node except "/vol1/dir1/." The restore job "job1" uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "restore run -n job1 -t restore"

Example 10: RESTORE FROM TAPE:

The following restore define command uses the -run argument to define and run the restore job "job1." The restore job "job1" uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "restore define 
-n job1 -t restore tape -f cmdfile -run"

The following is the "cmdfile" definition file used by the previous command. It restores the file "/file1" from tape "tape1" partition 1 to its original location using device cluster "cluster1."

Command Type

Command

OPTIONSRESTORE

"EOJ_ACTION R;" ; NODE (node1 UNIX) SELECT (I "/file1") FROM TAPE (tape1 1) DEVICECLUSTER cluster1 ;

Example 11: RESTORE CATALOG

The following restore define command uses the -c argument not only to start the command line interface but to define a restore job called "job1" in a single step. The restore job "job1" restores the Catalog and uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "restore define 
-n job1 -t restore_catalog -f cmdfile"

The following is the "cmdfile" definition file used by the previous command.

Command Type

Command

OPTIONS RESTORE

"EOJ_ACTION R;" ; CATALOG FROM TAPE (tape1 1) RDEVICE ("/vol1/" 4mm node1 UNIX 192.0.2.24) ;

Example 12: RESTORE IMAGE

The following restore define command uses the -run argument to define and run the restore job "job1." The restore job "job1" uses the definition file "cmdfile."

BEX -c "restore define -n job1 -t restore_image 
-f cmdfile -replace -run

The following is the "cmdfile" definition file used by the previous command. It restores image data from "/vol1/" to its original location on filer "node1."

Command Type

Command

OPTIONS RESTORE

"NDMP_ENV <>; NDMP_FH L; NDMP_LOG Y; REPLACE D;" ; NODE (node1 UNIX) DISK ("/vol1/") SELECT (I "/vol1/{NDMPDATA}"; I "/vol1/dir1/*") TO NODE (node1 UNIX) DISK "/vol2/" PATH "/vol2/" FROM CATALOG JOBID 12345678 ;

Example 13: RESTORE NDMP DATA

The following **restore define*8 command uses the -run argument to define and run the restore job "job1." The restore job "job1" uses the definition file "cmdfile."

BEX -c "restore define -n job1 -t restore_ads 
-f cmdfile -replace -run"

The following is the "cmdfile" definition file used by the previous command. It restores NDMP data from "/vol1/" to its original location on filer "node1."

Command Type

Command

**OPTIONS RESTORE*8

"REPLACE F;" ; NODE (node1 NDMP) SELECT (I "/vol1/{NDMPDATA}"; I "/vol1/*") FROM CATALOG ;

Example 14: RESTORE SNAPVAULT

The following restore define command uses the -run argument to define and run the restore job "job1." The restore job "job1" uses the definition file "cmdfile."

BEX -c "restore define -n job1 -t restore_snapvault 
-f cmdfile -replace -run"

The following is the "cmdfile" definition file used by the previous command. It restores SnapVault data from "/vol1/" to its original location on filer "node1."

Command Type

Command

OPTIONS RESTORE

"NDMP_ENV <>; NDMP_FH L; NDMP_LOG Y; REPLACE F;" ; NODE (node1 UNIX) SELECT (I "/vol1/*") TO NODE (node1 UNIX); PATH "/vol1/" FROM CATALOG JOBID 12345678 TASKID 1 ;

Example 15: DUPLICATING VOLSERS

The following duplicate define command uses the -c argument not only to start the command line interface but to define a duplicate job called "job1" in a single step. The duplicate job "job1" duplicates all the volsers related to the job instance specified in the definition file "cmdfile." The duplicate job "job1" uses the definition file "cmdfile."

BEX -s node1 -u sysadmin -p syspass -c "duplicate define 
-n job1 -t duplicate -f cmdfile"

The following is the "cmdfile" definition file used by the previous command. The volsers used in the duplicate job "job1," 12345678 and 12345679, will be duplicated. The twinned tapes will be marked off-site in the Catalog.

Command Type

Command

OPTIONS DUPLICATE

"TWINTAPEOFFSITE Y;" ; JOB job1 JOBID (12345678; 12345679) ;

Example 16: DUPLICATE DEFINE

The following duplicate define command uses the -run argument to define and initiate a duplicate job. The duplicate job "job1" uses the definition file "cmdfile."

BEX -c "duplicate define -n job1 -t duplicate -f cmdfile -run"

The following is the "cmdfile" definition file used by the previous command. It duplicates all the volsers related to the latest job instance of a job named "job1."

Command Type

Command

OPTIONS DUPLICATE

"TWINTAPEOFFSITE Y;" ; JOB job1 JOBID LATEST ;

Example 17: DUPLICATE RUN

The following duplicate run command starts a duplicate job named "job1."

BEX -c "duplicate run -n job1 -t duplicate"

Last updated