Retrieve

The retrieve command obtains copies of archived files from the IBM Spectrum Protectâ„¢ 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.

Mac OS X operating systemsNote: When a directory is retrieved, its modification date and time is set to the date and time of the retrieval, 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.
Windows operating systemsNote:
  1. 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.
  2. 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.
Windows operating systemsThe workstation name is part of the file name. Therefore, if you archive files on one workstation and you want to retrieve them to another workstation, you must specify a destination. This is true even if you are retrieving to the same physical workstation, but the workstation has a new name. For example, to retrieve the c:\doc\h2.doc file to its original directory on the workstation, named star, you would enter:
   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).
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsWindows operating systems

Supported Clients

This command is valid for all clients.

Mac OS X operating systemsAIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems

Syntax


1  RETrieve?     options
1    sourcefilespec
1    "sourcefilespec"
2?    destinationfilespec
Windows operating systems

Syntax


1  RETrieve?     options
1    sourcefilespec
1    { filespacename } sourcefilespec
2?    destinationfilespec

Parameters

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemssourcefilespec
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsSpecifies 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.
Windows operating systemssourcefilespec
Windows operating systemsSpecifies 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.
Windows operating systems{filespacename}
Windows operating systemsSpecifies 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.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsdestinationfilespec
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsSpecifies 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.

AIX operating systemsLinux operating systemsOracle Solaris operating systemsThis 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.

Windows operating systemsdestinationfilespec
Windows operating systemsSpecifies 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.
Table 1. Retrieve command: Related options
Option Where to use
Windows operating systemsdateformat Windows operating systemsClient options file (dsm.opt) or command line.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsdateformat AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsClient user options file (dsm.opt) or command line.
description Command line only.
dirsonly Command line only.
filelist Command line only.
filesonly Command line only
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsfollowsymbolic AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsClient user options file (dsm.opt) or command line.
fromdate Command line only
fromnode Command line only.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsMac OS X operating systemsfromowner AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsMac OS X operating systemsCommand line only
fromtime Command line only
ifnewer Command line only
pick Command line only.
preservepath Command line only.
Windows operating systemsreplace Windows operating systemsClient options file (dsm.opt) or command line.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsreplace AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsClient user options file (dsm.opt) or command line.
Windows operating systemsskipntpermissions Windows operating systemsClient options file (dsm.opt) or command line
Windows operating systemsskipntsecuritycrc Windows operating systemsClient options file (dsm.opt) or command line
Windows operating systemssubdir Windows operating systemsClient options file (dsm.opt) or command line.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemssubdir AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsClient user options file (dsm.opt) or command line.
Windows operating systemstapeprompt Windows operating systemsClient options file (dsm.opt) or command line.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemstapeprompt AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsClient user options file (dsm.opt) or command line.
Windows operating systemstimeformat Windows operating systemsClient options file (dsm.opt) or command line.
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemstimeformat AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsClient user options file (dsm.opt) or command line.
todate Command line only.
totime Command line only.

Examples

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve a single file named budget.

retrieve /home/devel/projecta/budget

Windows operating systemsTask
Windows operating systemsRetrieve a single file named budget.fin.

ret c:\devel\projecta\budget.fin

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve all files with an extension of .c from the /home/devel/projecta directory.

retrieve "/home/devel/projecta/*.c"

Windows operating systemsTask
Windows operating systemsRetrieve all files with an extension of .c from the c:\devel\projecta directory.

ret c:\devel\projecta\*.c

Windows operating systemsTask
Windows operating systemsRetrieve all files with a file extension of .c from the \devel\projecta directory on the winnt file space.

ret {winnt}\devel\projecta\*.c

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve all files in the /home directory.

retrieve /home/

Windows operating systemsTask
Windows operating systemsRetrieve all files in the c:\devel directory.

ret c:\devel\*

Windows operating systemsTask
Windows operating systemsRetrieve files from the abc file space proj directory.

ret {abc}\proj\*.*

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve 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/

Windows operating systemsTask
Windows operating systemsRetrieve 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\

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve files in the /user/project directory. Use the pick option.

ret "/user/project/*" -pick

Windows operating systemsTask
Windows operating systemsRetrieve files in the c:\project directory. Use the pick option.

ret c:\project\* -pick

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve all files that were archived from the /proj directory with the description 2012 survey results.

retrieve "/proj/*" -desc="2012 survey results"

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsTask
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsRetrieve 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
Mac OS X operating systemsTask
Mac OS X operating systemsRetrieve 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/

Windows operating systemsTask
Windows operating systemsRetrieve 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\