The following guide describes how to restore files and folders from TSM Server using TSM Client command line.
The basic syntax for restoring data from TSM is the following:
tsm> restore [source-file] [destination-file]
If the destination of restoration is omitted, then the TSM will restore the file to its original location.
By default, the TSM restores the most current active version of a file.
Restoration of a Single File
To specify a directory as a destination, you need to add slash “/” at the end of the destination path of restoration. Note that the TSM may overwrite a file of the same name in the destination directory.
tsm> restore /home/john/MyFile.txt /home/john/restore/
The following example demonstrates that the restored file will be named MyFile-rest.txt.
tsm> restore /home/john/MyFile.txt /home/john/restore/MyFile-rest.txt
Restoration of Multiply Files
Multiply files can be restored using “file by file” restoration like above, or using wildcards.
- ? – for a single character substitution;
- * – for multiple characters substitution.
ATTENTION: You cannot use wildcards in the names of the folders.
tsm> restore /home/john/MyFi?e.txt /home/john/restore/ tsm> restore /home/john/*.txt /home/john/restore/
Restoration of Multiple Files and Folders
To restore a full directory and the contents of all its sub-directories you need to use
tsm> restore -subdir=yes /home/john/files/* /home/john/restore/
Restoration of Entire Partitions
Essentially, the syntax is the same as in “Restoration of Multiple Files and Folders” above. However, the obvious caveats are to ensure that you have enough space in the destination partition.
tsm> restore -subdir=yes /home /tmp/restore/
Point in Time Restoration
Here is the syntax for the restoration of a single file for specific date and time . Syntax is the same for the other cases.
There are three different types of date available for restores:
- todate – will restore all ACTIVE and INACTIVE files backed up BEFORE the date specified;
- fromdate – will restore all ACTIVE and INACTIVE files backed up AFTER the indicated date;
- pitdate – will restore only the files that were ACTIVE on the day specified.
You can use
-pittime options together or separately.
tsm> restore -pitdate=MM/dd/YYYY -pittime=hh:mm \ /home/john/MyFile.txt /home/john/restore/
- MM – a month
- dd – a day
- YYYY – a year
- hh – an hour
- mm – minutes
TIP: The format of pitdate command differs upon the clients. Use the same format as your client uses.
Restoration of Old 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 want to restore a such file, you need use the
-pick option causes TSM to display a list of files from which you can pick.
Issuing a restore as below will display a pick window.
tsm> restore -subdir=yes -inactive -pick /home/john/* /tmp/restore/
In a pick interface you will be able to select files to restore via the numbers.
Remember to issue the destination path of restoration with the original restore command if you want to prevent overwriting current versions of files with older versions.