IBM Spectrum Protect Client Command Line Utility for Windows


In this article:


Getting Started

Run [Backup-Archive Command Line] from [Start] | [All Programs] | [Tivoli Storage Manager]. The TSM command line interface will open in a window on the Windows desktop. This window will be small but you can change its size, color, or font by right clicking on the icon in the top left corner and selecting [Properties]. You should see a prompt of the form:

Windows prompt
top


Accessing Help

Online help for TSM commands, options and error messages is available by typing help at the Protect> or tsm> prompt. The result will be similar to below: 

IBM Tivoli Storage Manager Help

Note that commands and options may be abbreviated to a short form as indicated by capitalization of words in the syntax entry for a command.

Thus, for example, query filespace can be abbreviated to q fi.

top


Querying your scheduled backup slot

To query your scheduled backup slot enter q sched (which is short for query schedule). The output should look similar to that below:

Query your backup

 

Querying what files are included/excluded for backup

At the Protect> prompt enter q inclexcl to list output similar to the following:

Query what files are included or excluded

Note that the include/exclude directives are listed at the partition level first, then the directory/folder level and finally at the file level. The order they are displayed above is the order in which these directives are applied by TSM. You will note that the order of the directives at any one level is the opposite of the order in which they appear in the options file. That is, TSM reads the directives listed in options file from the bottom up.

 


Querying what partitions have been backed up

At the Protect> prompt enter q fi to list which partitions have been backed up:

Query what partitions have been backed up

 

Querying what files have been backed up

The syntax for querying what files you have backed up involves giving a file specification which is necessarily OS specific. Also, if an incorrect file specification is given it may appear that you have no backups.Query what files have been backed up 

Note that file specifications with spaces in them will need to be quoted. Thus to query all the files backed up under C:\Documents and any sub-directories below it, the following input would be required:

Query files that have been backed up 

top


Backing up local disks

The basic syntax for backing up local disk volumes is dsmc backup-type disk volume(s), where backup-type is one of incremental or selective. We recommend incremental backups only; selective backups cause data to be sent even if it already exists on the HFS. By default, if the disk volume is omitted, TSM will back up those volumes specified by the Domain option in the dsm.opt options file. If Domain is set to All-Local, then to backup all local volumes enter:

Protect> incr

where incr is an abbreviation for incremental.

To incrementally backup specific volumes enter:

Protect> incr  C:  D:  F:

To run an incremental by date backup of the above, add the -incrbydate option, as in:

Protect> incr  C:  D:  F:    -incrbydate

To back up entire disk volumes irrespective of whether files have changed since the last backup, use the selective command with a wildcard and -subdir=yes as below:

Protect> sel C:\*  D:\*  F:\*     -subdir=yes

 


Backing up selected files

The basic syntax for backing up selected files is similar to that for backing up disk partitions. Be aware, however, that you cannot use wildcards in directory/folder names:

Protect> incr “C:\My Docum*\*” -subdir=yes
ANS1071E Invalid domain name entered: 'C:\My Docum*\*'

You can, however, enter several file specifications on the command line, as below:

Protect> incr "C:\My Documents\Word docs\*" "C:\My Documents\html docs\*" -su=yes

top


Restoring your data

The basic syntax for restoring your data is

C:>\Program Files\Tivoli\tsm\baclient> dsmc restore source-file destination-file.

If the destination-file is omitted then TSM will restore the file(s) to their original location. Be aware that, as with backup, you cannot use wildcards in directory/folder names. By default, TSM will restore the most current active version of a file.

Restoring selected files

Protect> rest "C:\My Documents\Word docs\mydoc.doc" "C:\My Documents\restore\"

Protect> rest "C:\My Documents\Word docs\mydoc.doc" "C:\My Documents\restore\mydoc.doc"

Note from the first example of each restore above that in order to specify a directory as a destination, you need a trailing \(backslash) at the end of the destination-filespec. Otherwise TSM may overwrite a file of the same name. The second example demonstrates a filename in the destination-filespec.

Restores of single files cannot be restarted if interrupted. In this case you will need to restore the file afresh.

Restoring multiple files and directories

Protect> rest "C:\My Documents\Word docs\*" "C:\My Documents\restore\" -su=yes

Note that in order to restore a full directory and the contents of all its sub-directories you need the -su=yes option. It is always good practice to terminate the destination-filespec with a trailing \ (backslash) if the element in the destination-filespec is a directory.

As this restore is wild-carded, it can be restarted if interrupted due to user input (Ctrl-C), server error or communications error. Restartable restores can be queried via q rest and will restart at the point of interruption.

Restoring entire partitions (“drives”)

Essentially, the syntax is the same as in 'Restoring multiple files and directories' above. However, the obvious caveats are to ensure enough space in the destination partition and to allow enough time.

Protect> restore C:\* D:\restore\ -subdir=yes

Restoring old and/or deleted files

As with the GUI, TSM does not, by default, list or restore old and deleted inactive versions of files and directories. If you need to restore such a file, you need the -inactive -pick options. The -pick option, while not strictly necessary, causes TSM to display a list of files from which to pick. Issuing a restore as below will display the following pick window:

Protect> restore “C:>Program Files\projects\*” “C:>restore\” -su=yes -inactive -pick

TSM Scrollable Pick Window Restore

You are now in the pick interface and can select individual files to restore via the number to the left, scroll up or down via U and D as described at the bottom of each listing of files.

Remember to issue the destination-filespec with the original restore command if you want to prevent overwriting current versions of files with older versions.

top


Restoring your data to another machine

In certain circumstances, it may be necessary to restore some, or all, of your data onto a machine other than the original from which it was backed up. Ideally the machine platform should be identical to that of the original machine. Where this is not possible or practical please note that restores are only possible for partition types that the operating system supports. Thus a restore of an NTFS partition to a Windows 9x machine with just FAT support may succeed but the file permissions will be lost. Please do not attempt cross-platform restores, e.g. by trying to restore files onto a Windows machine that have previously been backed up with a non-Windows one: using TSM for Windows to try to access backups sent by other OS platforms can cause those backups to become inaccessible from the host system.

To restore your data to another machine you will need the TSM software installed on the target machine. To access files from the source machine you should then start the TSM client on target machine as below:

C:\Program Files\Tivoli\TSM\baclient\ dsmc -virtualnodename=DEAD.MACHINE

where DEAD.MACHINE should be substituted for the nodename of the machine to be restored. You will then be prompted for the TSM password for this machine.

Querying and restoring the filestore is then as in the previous section, Restoring your data.

You will probably want to restore to a different destination to the original files to prevent overwriting files on the local machine, as below:

Protect> rest D:\* D:\RESTORE\ -su=yes 

top