Oracle® Secure Backup Reference Release 10.1 Part Number B14236-03 |
|
|
PDF · Mobi · ePub |
Use obtar -x
to extract files from a backup image. You can extract the entire contents of a backup image or only part of the backup image.
To restore data to your own directories, you do not need special rights. To restore data into directories as root
, you must be either be logged in as root
or specify the -R
option with the obtar
command.
obtar -x [ -kpORvzZ ] [ -f device ]... [ -F { cur|file-number } ] [ -H destination-host ] [ -s,prefix,[replacement,] ] [ pathname ]...
You can specify a number of options with obtar -x
; this section describes those options that you are most likely to use. Refer to "obtar Options" to learn about additional obtar -x
options.
pathname
Specifies the path names of files or directories to be extracted from the backup image. If you specify a directory, then obtar
recursively extracts the contents of the directory. If you do not specify a path name, then obtar
extracts the entire contents of the backup image.
device
]Specifies the name of the device where the data is located. If you do not specify -f
, then obtar
reads from the device specified by the TAPE
environment variable, if it is defined.
cur|file-number
]Specifies the number of the backup image on the volume set. If you do not specify -F
, then obtar
extracts the backup image at the volume's current position.
If you specify cur
, then obtar
extracts the backup image at the volume's current position. This is the default.
If you specify file-number
, then obtar
extracts the backup image at the specified file position.
destination-host
Specifies the host to which the data will be restored. If you do not specify -H
, then obtar
restores the data to the local host.
prefix
,[replacement
,]Specifies where obtar
should place the extracted files and directories. Use this option to extract files from a backup image and place them in a location that differs from the place from which you backed them up.
When you use -s
, obtar
substitutes the replacement
string for prefix
in the path name being restored. prefix
must include the leftmost part of the original path name. For example, if you backed up the directory /home/jane/test
, and if you wanted the data restored to /home/tmp/test
, then you would specify the string as follows: -s,/home/jane,/home/tmp,
.
If you omit the replacement
string, then obtar
assumes a null
string, which causes obtar
to remove the prefix
from every pathname
where it is found. The delimiter character, shown as a comma (,
) in the syntax statement, can be any character that does not occur in either the prefix
or the replacement
string.
When you use -s
, obtar
displays the names of the files or directories as they are restored.
Prevents obtar
from overwriting any existing file that has the same name as a file in the backup image. In other words, obtar
only restores files that do not already exist.
Causes obtar
to restore data with the same permissions and ownership that they had in the backup image. If you do not specify -p
, then obtar
applies the current umask
to the restored permissions.
Causes obtar
to stop after restoring the requested files. If -O
is not specified, then obtar
searches the entire backup image for subsequent copies of the requested files.
Causes obtar
to run with root
access. To use -R
you must be a member of a class with the perform restores as privileged user right. You do not need to use -R
if you are logged in as root
.
Displays the path names of the files and directories being restored. If you specify -v -v
(or -vv
), then obtar
displays the path names of files and directories being restored and their permissions, owner, size, and date of last modification.
Displays the volume label of the backup image if it has one.
Prevents obtar
from uncompressing any data that was compressed previously with -Z
. If you do not specify -Z
, then obtar
uncompresses any data that was compressed previously with -Z
.
Extracting Files from a Backup Image
Example 4-15 extracts the contents of backup image 4, which is on the volume loaded on device tape1
.
Displaying the Contents of a Backup Image
Example 4-16 uses the -v
option to display the contents of the backup image as it is being extracted.
Example 4-16 Displaying the Contents of a Backup Image
obtar -x -v -f tape1 -F 4 doc/ doc/chap1 doc/chap2 test/ test/file1 test/file2
Example 4-17 uses the -z
option to display the volume label of the volume being extracted.
Extracting Data to a Different Location
Use the -s
option to place the extracted data in a location different from its original location. This option is particularly useful if you have backed up data and specified absolute path names. If you do not use -s
, then obtar
restores the data into the original directory, overwriting any existing data with that same name. Example 4-18 extracts the /doc
directory and places it in a directory called /tmp/doc
.
Example 4-19 prevents obtar
from overwriting any files in the /doc
directory that have the same names as files in the backup image:
Example 4-20 restores the contents of a raw file system partition. The partition is assumed to have been previously formatted and to be currently unmounted.