Preservepath
The preservepath option specifies how much of the source path to reproduce as part of the target directory path when you restore or retrieve files to a new location.
Use the -subdir=yes option to include the entire subtree of the source directory (directories and files below the lowest-level source directory) as source to be restored. If a required target directory does not exist, it is created. If a target file has the same name as a source file, it is overwritten. Use the -replace=prompt option to have the client prompt you before files are overwritten.
Use the preservepath option with the following commands:
- restore
- restore backupset
- restore group
- retrieve
Supported Clients
This option is valid for all clients. The IBM Spectrum® Protect API does not support this option. The server can also define this option.
Syntax
Parameters
- Subtree
- Creates the lowest-level source directory as a subdirectory of the target directory. Files from the source directory are stored in the new subdirectory. This is the default.
- Complete
- Restores the entire path, starting from the root, into the specified directory. The entire path includes all the directories except the file space name.
- NOBase
- Restores the contents of the source directory without the lowest level, or base directory, into the specified destination directory.
- NONe
- Restores all selected source files to the target directory. No part of the source path at or
above the source directory is reproduced at the target.
If you specify SUBDIR=yes, the client restores all files in the source directories to the single target directory.
Examples
- Command line:
- Assume that the server file space contains the following backup
copies:
/fs/h1/m1/file.a /fs/h1/m1/file.b /fs/h1/m1/l1/file.x /fs/h1/m1/l1/file.y
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -preser=complete
Restores these directories and files:/u/ann/h1/m1/file.a /u/ann/h1/m1/file.b
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -preser=nobase
Restores these directories and files:/u/ann/file.a /u/ann/file.b
- This command:
-
dsmc res backupset /fs/h1/m1/ /u/ann/ -su=yes -preser=nobase -loc=file
Restores these directories and files:/u/ann/file.a /u/ann/file.b /u/ann/file.x /u/ann/file.y
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -preser=subtree
Restores these directories and files:/u/ann/m1/file.a /u/ann/m1/file.b
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -preser=none
Restores these directories and files:/u/ann/file.a /u/ann/file.b
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -su=yes -preser=complete
Restores these directories and files:/u/ann/h1/m1/file.a /u/ann/h1/m1/file.b /u/ann/h1/m1/l1/file.x /u/ann/h1/m1/l1/file.y
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -su=yes -preser=nobase
Restores these directories and files:/u/ann/file.a /u/ann/file.b /u/ann/l1/file.x /u/ann/l1/file.y
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -su=yes -preser=subtree
Restores these directories and files:/u/ann/m1/file.a /u/ann/m1/file.b /u/ann/m1/l1/file.x /u/ann/m1/l1/file.y
- This command:
-
dsmc res /fs/h1/m1/ /u/ann/ -su=yes -preser=none
Restores these directories and files:/u/ann/file.a /u/ann/file.b /u/ann/file.x /u/ann/file.y
- Command line:
- Assume the server file space contains the
following backup copies:
c:\h1\m1\file.a c:\h1\m1\file.b c:\h1\m1\l1\file.x c:\h1\m1\l1\file.y
- This command:
dsmc res backupset my.backupset.file /fs/h1/m1/ /u/ann/ -su=yes
creates a local backupset file named "my.backupset.file".Restores these directories and files:c:\ann\h1\m1\file.a c:\ann\h1\m1\file.b
- This command:
dsmc res c:\h1\m1\ c:\ann\ -preser=nobase
.Restores these directories and files:c:\ann\file.a c:\ann\file.b
- This command:
dsmc res c:\h1\m1\ c:\ann\ -preser=subtree
.Restores these directories and files:c:\ann\m1\file.a c:\ann\m1\file.b
- This command:
dsmc res c:\h1\m1\ c:\ann\ -preser=none
.Restores these directories and files:c:\ann\file.a c:\ann\file.b
- This command:
-
dsmc res c:\h1\m1\ c:\ann\ -su=yes -preser= complete
Restores these directories and files:c:\ann\h1\m1\file.a c:\ann\h1\m1\file.b c:\ann\h1\m1\l1\file.x c:\ann\h1\m1\l1\file.y
- This command:
dsmc res c:\h1\m1\ c:\ann\ -su=yes -preser=nobase
.Restores these directories and files:c:\ann\file.a c:\ann\file.b c:\ann\l1\file.x c:\ann\l1\file.y
- This command:
dsmc res c:\h1\m1\ c:\ann\ -su=yes -preser=subtree
.Restores these directories and files:c:\ann\m1\file.a c:\ann\m1\file.b c:\ann\m1\l1\file.x c:\ann\m1\l1\file.y
- This command:
dsmc res c:\h1\m1\ c:\ann\ -su=yes -preser=none
.Restores these directories and files:c:\ann\file.a c:\ann\file.b c:\ann\file.x c:\ann\file.y
- This command:
-
dsmc res backupset c:\h1\m1\ c:\ann\ -su=yes -preser=nobase -loc=file
Restores these directories and files:c:\ann\file.a c:\ann\file.b c:\ann\file.x c:\ann\file.y