Retrieve
The retrieve command obtains copies of archived files from the Tivoli® Storage Manager server. You can retrieve specific files or entire directories.
Use the description option to specify the descriptions that are assigned to the files you want to retrieve.
Use the pick option to display a list of your archives from which you can select an archive to retrieve.
Retrieve the files to the same directory from which they were archived, or to a different directory. he backup-archive client uses the preservepath option with the subtree value as the default for restoring files.
- When a directory is retrieved, its modification date and time is set to the date and time of the retrieve, not to the date and time the directory had when it was archived. This is because the backup-archive client retrieves the directories first, then adds the files to the directories.
- An error occurs if you attempt to retrieve a file whose name is
the same as the short name of an existing file. For example, if you
attempt to retrieve a file you specifically named ABCDEF~1.DOC into
the same directory where a file named abcdefghijk.doc exists,
the retrieve fails because the Windows operating
system equates the file named abcdefghijk.doc to
a short name of ABCDEF~1.DOC. The retrieve function
treats this as a duplicate file. If this error occurs, perform any of the following actions to correct it:
- Retrieve the file with the short file name you specified to a different location.
- Stop the retrieval, and change the name of the existing file.
- Disable the short file name support on Windows.
- Do not use file names that conflict with the short file naming convention. For example, do not use ABCDEF~1.DOC.
dsmc retrieve c:\doc\h2.doc \\star\c$\
The workstation named star has been
renamed and the new name is meteor. To retrieve the c:\doc\h2.doc file to
meteor, you would enter: dsmc retrieve c:\doc\h2.doc \\meteor\c$\
You could
also enter: dsmc retrieve c:\doc\h2.doc \\star\c$\
You can enter the
command in either of the preceding ways because if the workstation name is not included in the
specification, the local workstation is assumed (meteor, in this case).Supported Clients
This command is valid for all clients.
Syntax
>>-RETrieve--+------------+--+- --sourcefilespec---+------------> '- --options-' '- --"sourcefilespec"-' >--+------------------------+---------------------------------->< '- --destinationfilespec-'
Syntax
>>-RETrieve--+------------+-------------------------------------> '- --options-' >--+- --sourcefilespec----------------------+-------------------> '- --{--filespacename--}--sourcefilespec-' >--+------------------------+---------------------------------->< '- --destinationfilespec-'
Parameters
- sourcefilespec
- Specifies the path and file name that you want to retrieve. Use wildcard characters to specify a group of files or all the files in a directory.
- sourcefilespec
- Specifies the path and file name that you want to retrieve. Use
wildcard characters to specify a group of files or all the files in
a directory. Note: If you include filespacename, do not include a drive letter in the file specification.
- {filespacename}
- Specifies the file space (enclosed in braces) on the server that
contains the files you want to retrieve. This name is the drive label
on the workstation drive from which the files were archived. Use the file space name if the drive label name has changed, or if you are retrieving files that were archived from another node that had drive label names that are different from yours.Note: You must specify a mixed or lowercase NTFS or ReFS file space name that is enclosed in quotation marks and braces. For example, {"NTFSDrive"}. Single quotation marks or quotation marks are valid in loop mode. For example: {"NTFSDrive"} and {'NTFSDrive'} are both valid. In batch mode, only single quotation marks are valid. The single quotation marks requirement is a restriction of the operating system.
- destinationfilespec
- Specifies the path and file name where you want the files to be written. If you do not specify a
destination, the client restores the files to the original source path. Note: If you do not specify a destination, the backup-archive client determines whether the original file system can be reached. If the original file system cannot be reached, the client does not restore the file.
This failure can also occur if you remove the virtualmountpoint option from the dsm.sys file. In this case, you can specify a different destination, or restore the original virtualmountpoint option to the dsm.sys file, restart the client, and try the command again.
- destinationfilespec
- Specifies the path and file name where you want the files to be written. If you do not specify a
destination, the client restores the files to the original source path. When you enter the destinationfilespec string, consider the following points:
- If the sourcefilespec names a single file, the destinationfilespec can be a file or a directory.
- If the sourcefilespec is wildcarded or if you specify the subdir=yes option, the destinationfilespec must be a directory and end with a directory delimiter (\).
Note: If the destination path or any part of it does not exist, the client creates it.
Option | Where to use |
---|---|
dateformat | Client options file (dsm.opt) or command line. |
dateformat | Client user options file (dsm.opt) or command line. |
description | Command line only. |
dirsonly | Command line only. |
filelist | Command line only. |
filesonly | Command line only |
followsymbolic | Client user options file (dsm.opt) or command line. |
fromdate | Command line only |
fromnode | Command line only. |
fromowner | Command line only |
fromtime | Command line only |
ifnewer | Command line only |
pick | Command line only. |
preservepath | Command line only. |
replace | Client options file (dsm.opt) or command line. |
replace | Client user options file (dsm.opt) or command line. |
skipntpermissions | Client options file (dsm.opt) or command line |
skipntsecuritycrc | Client options file (dsm.opt) or command line |
subdir | Client options file (dsm.opt) or command line. |
subdir | Client user options file (dsm.opt) or command line. |
tapeprompt | Client options file (dsm.opt) or command line. |
tapeprompt | Client user options file (dsm.opt) or command line. |
timeformat | Client options file (dsm.opt) or command line. |
timeformat | Client user options file (dsm.opt) or command line. |
todate | Command line only. |
totime | Command line only. |
Examples
- Task
- Retrieve a single file named budget.
retrieve /home/devel/projecta/budget
- Task
- Retrieve a single file named budget.fin.
ret c:\devel\projecta\budget.fin
- Task
- Retrieve all files with an extension of .c from
the /home/devel/projecta directory.
retrieve "/home/devel/projecta/*.c"
- Task
- Retrieve all files with an extension of .c from
the c:\devel\projecta directory.
ret c:\devel\projecta\*.c
- Task
- Retrieve all files with a file extension of .c from
the \devel\projecta directory on the winnt file
space.
ret {winnt}\devel\projecta\*.c
- Task
- Retrieve all files in the /home directory.
retrieve /home/
- Task
- Retrieve all files in the c:\devel directory.
ret c:\devel\*
- Task
- Retrieve files from the abc file space proj directory.
ret {abc}\proj\*.*
- Task
- Retrieve all files with a file extension of .c from
the /home/devel/projecta directory to the /home/newdevel/projectn/projecta directory.
If the /projectn or the /projectn/projecta directory
does not exist, it is created.
retrieve "/home/devel/projecta/*.c" /home/newdevel/projectn/
- Task
- Retrieve all files with a file extension of .c from
the c:\devel\projecta directory to the c:\newdevel\projectn\projecta directory.
If the \projectn or the \projectn\projecta directory
does not exist, it is created.
ret c:\devel\projecta\*.c c:\newdevel\projectn\
- Task
- Retrieve files in the /user/project directory.
Use the pick option.
ret "/user/project/*" -pick
- Task
- Retrieve files in the c:\project directory.
Use the pick option.
ret c:\project\* -pick
- Task
- Retrieve all files that were archived from the /proj directory
with the description "2012 survey results".
retrieve "/proj/*" -desc="2012 survey results"
- Task
- Retrieve archived file /home/devel/budget with
description "my budget" to the /dev/rmt1 tape
drive.
mkfifo fifo dd if=fifo of=/dev/rmt1& dsmc retrieve -replace=yes -description="mybudget" /home/devel/budget fifo
- Task
- Retrieve a file from the renamed file space Jaguar_OLD to
its original location. Enter both the source and destination as follows:
ret Jaguar_OLD/user5/Documents/myresume.doc /Users/user5/Documents/
- Task
- Retrieve a file from the renamed file space \\your-node\h$_OLD to
its original location. Enter both the source and destination as follows:
ret \\your-node\h$_OLD\docs\myresume.doc h:\docs\