Command line restore examples
This topic lists some examples of restore commands to use for specific tasks.
The following table shows examples of how to use the restore command to restore objects from IBM Spectrum® Protect server storage.
Task | Command | Considerations |
---|---|---|
Restore the most recent
backup version of the /Users/monnett/Documents/h1.doc file,
even if the backup is inactive. |
dsmc restore
/Users/monnett/Documents/h1.doc -latest |
If the file you are restoring no longer resides on your workstation, and you have run an incremental backup since deleting the file, there is no active backup of the file on the server. In this case, use the latest option to restore the most recent backup version. IBM Spectrum Protect restores the latest backup version, whether it is active or inactive. See Latest for more information. |
Display a list of active and inactive backup versions of files from which you can select versions to restore. | dsmc restore
"/Users/monnett/Documents/*"-pick -inactive |
If you try to restore both an active and inactive version of a file at the same time, only the active version is restored. See Pick and Inactive for more information. |
Restore the /Users/monnett/Documents/h1.doc file
to its original directory. |
dsmc restore
/Users/monnett/Documents/h1.doc |
If you do not specify a destination, the files are restored to their original location. |
Restore the /Users/monnett/Documents/h1.doc file
under a new name and directory. |
dsmc restore
/Users/monnett/Documents/h1.doc /Users/gordon/Documents/h2.doc |
None |
Restore the files
in the /Users directory and all of its subdirectories. |
dsmc restore
/Users/ -subdir=yes |
When restoring a specific path and file, IBM Spectrum Protect recursively restores all subdirectories under that path, and any instances of the specified file that exist under any of those subdirectories. See Subdir for more information about the subdir option. |
Restore all files
in the /Users/gordon/Documents directory to their
state as of 1:00 PM on August 17, 2003. |
dsmc restore
-pitd=8/17/2003 -pitt=13:00:00 /Users/gordon/Documents/ |
See Pitdate and Pittime for more information about the pitdate and pittime options. |
Restore all files
from the /Users/mike/Documents directory that end
with .bak to the /Users/mike/projectn/ directory. |
dsmc restore
"/Users/mike/Documents/*.bak" /Users/mike/projectn/ |
If the destination
is a directory, specify the delimiter (/ ) as the
last character of the destination. If you omit the delimiter and your
specified source is a directory or a file spec with a wildcard, you
receive an error. If the projectn directory does
not exist, it is created. |
Restore files specified
in the restorelist.txt file to a different location. |
dsmc restore
-filelist=/Users/user2/Documents/ restorelist.txt /Users/NewRestoreLocation/ |
See Filelist for more information about restoring a list of files. |