6. Retrieving your data
6.1. Retrieving selected files
Unlike the TSM GUI, you cannot get a straight list of archived files which you can retrieve. As a result you will
probably wish to query the server for a list of files, before retrieving a (sub)selection of them. Basic queries are
listed in the examples above ( see section querying the server ). Having
done that, the basic syntax for archive file retrieval is dsmc retrieve source-file destination-file.
If the destination-file is omitted then TSM will retrieve the file(s) to their original location. If a file
of the same name is found in the destination location, TSM will prompt you whether to overwrite or not the current
file.
The simplest form of retrieve is for a single file or file pattern
tsm> retr join.jpg
The file may be wildcarded to specify more than one file, as below.
tsm> retr j*.*
6.2. Retrieving multiple files and directories
To retrieve all files in a directory add a trailing slash on the end of the file path:
tsm> retr "C:\My Documents\html-docs\Mac\"
When specifying an alternative destination for retrieved files, remember to terminate it with a trailing slash:
tsm> retr "C:\My Documents\html-docs\Mac\" C:\retrieve # Wrong ! Retrieve function invoked. --- User Action is Required --- File '\\cles.oucs:c$\retrieve' exists tsm> retr "C:\My Documents\html-docs\Mac\" C:\retrieve\ # Correct !
To retrieve all files in a directory tree, add the trailing slash on the end of the file path and include the
-su=yes
tsm> retr "C:\My Documents\html-docs\Mac\" C:\retrieve\ -su=yes
By default TSM will create a subdirectory in the destination directory for each lowest level source directory, and
place files in there. Thus, in the example above, if there were two subdirectories new and
old under \html-docs\Mac\, then TSM would create two subdirectories named
new and old under C:\retrieve\. This behaviour can be modified by using
the -preservepath= option - see the online help for worked examples of the four values this option
can take.
6.3. Retrieving selected archive versions of files
Where more than one version of a file has been archived, then a basic retrieve using just the file path will
cause TSM to retrieve each version of that file, starting with the earliest and ending with the most recent
archive copy. Once the earliest copy has been retrieved, TSM will prompt to overwite it with each more recent
archive copy. To prevent this happening the -description= option should be used in both the
query of archived files and the subsequent retrieval of files.
Thus, to query the server for just a subset of files archived under a certain path, run something like:
tsm> q ar /scratch/test1/j*.jpg -desc="Jenkins*"
Size Archive Date - Time File - Expires on - Description
---- ------------------- -------------------------------
2,411,227 28-06-2002 10:51:37 /scratch/test1/j1.jpg Never Jenkins 1st Initial Scan
2,411,227 30-06-2002 15:07:24 /scratch/test1/j1.jpg Never Jenkins 1st - 1st amend
2,411,227 01-07-2002 12:01:06 /scratch/test1/j1.jpg Never Jenkins 1st - 2nd amend
2,411,227 01-07-2002 12:01:06 /scratch/test1/j1.jpg Never Jenkins 1st Final Version
760,632 28-06-2002 10:51:37 /scratch/test1/j2.jpg Never Jenkins 2nd Initial Scan
760,632 28-06-2002 16:46:03 /scratch/test1/j2.jpg Never Jenkins 2nd - 1st amend
760,632 28-06-2002 17:18:54 /scratch/test1/j2.jpg Never Jenkins 2nd - 2nd amend
760,632 28-06-2002 17:22:28 /scratch/test1/j2.jpg Never Jenkins 2nd - 3rd amend
760,632 01-07-2002 12:01:06 /scratch/test1/j2.jpg Never Jenkins 2nd Final Version
To retrieve just the Final Version of the above files to their original location on the local machine:
tsm> retr /scratch/test1/j*.jpg -desc="Final Version"
Up: Contents Previous: 5. Archiving your data Next: 7. Retrieving your data to another machine

