Use obtar
-g
to create backup images for the directories and files specified in the backup description file. obtar
automatically creates a volume label (-z
option), updates the backup dates files, and generates an index file (-G
option).
obtar -g backup-description-file [ -f devicename ] [ -F { cur | end | file-number } ] [ -L backup-level ] [ -lR ] [ -v [ -v ] ] [ -z ]
You can specify a number of options with obtar -g
; this section describes those options that you are most likely to use. Refer to "obtar Options" for information about additional obtar -g
options.
backup-description-file
Specifies the path name of the backup description file (BDF). If you specify a host name as part of the backup description file name, as in -g brhost:/work/mybdf
, then the Oracle Secure Backup client software must be installed on this host. If you specify a relative path name for the backup description file, then obtar
looks for it with respect to the current directory.
In addition to data, obtar
records each of the path names specified in the BDF as part of the backup image. When you restore that data, obtar
uses this path name as the location for the restored data. The obtar -x
command, which you use to restore data, provides options that let you specify a different host or directory location for the restored data.
By default, obtar -g
does not cross local or remote mount points. You can override this behavior by using mount point statements in a BDF (see "Mount Point Statement") or specifying the -Xcrossmp option.
obtar
issues a warning if the contents of a file change during a backup of the file.
devicename
Specifies the name of a backup device created with the mkdev
command. If you do not specify -f
, then obtar
writes to the device specified by the TAPE
environment variable, if it is defined.
cur | end |
file-number
}If you specify cur
, then obtar
writes the backup image at the current volume position. cur
is the default if you do not specify the -F
option.
If you specify end
, then obtar
writes the new backup image immediately after the last existing backup image on the volume set. Use this option when the last backup image was written completely. (If obtar
failed with a media error while writing the last backup image, then -F
end
will produce undesirable results.)
If you specify file-number
, then obtar
writes the backup image at the specified file position. obtar
numbers each of the backup images on a volume beginning with 1. When you specify -F 1
, obtar
writes the backup image at the beginning of the volume. If you specify a number greater than 1, then at least file-number
- 1 backup images must already exist on the volume.
backup-level
Specifies a backup level. If you omit this option, then obtar
performs a full backup.
Forces obtar
not to cross file system mount points when backing up or restoring. Note that if you also specify -Xchkmnttab, then specifying -l
causes obtar
to consult the mount table (/etc/mnttab
) to avoid crossing remote mount points.
Runs obtar
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 backup image label and the path names of files and directories being backed up. If you specify -v -v
(or -vv
),then obtar
displays the backup image label as well as the path names, permissions, owner, size, and date of last modification of the files and directories being backed up.
Creating a Backup Image on a Volume
The command in Example 4-5 uses the BDF named all_bdf
to create a backup image at the current tape position on the volume loaded on the device tape1
.
The command in Example 4-6 creates a backup image using the BDF named rd_bdf
located on the host named hershey
. Note that hershey
must have Oracle Secure Backup installed.
The command in Example 4-7 specifies that obtar
should perform a full backup of the data specified in the BDF called all_bdf
. The -R
option indicates that the command should run with root
privileges.
Creating an Incremental Backup
The command in Example 4-8 specifies that obtar
should perform an incremental backup on that same data shown in Example 4-7.
Displaying Information About the Backup Image
Example 4-9 uses -v
to display information about the data being backed up. obtar
displays the backup image's volume label as well as the path names of the data being backed up.
Example 4-9 Displaying Information About a Backup
obtar -g first_bdf -f tape1 -v Backup started on Wed Nov 09 2005 at 14:57:42 Volume label: Volume ID: VOL000009 Volume sequence: 1 Volume set owner: root Volume set created: Tue Nov 08 14:54:32 2005 Archive label: File number: 4 File section: 1 Owner: lashdown Client host: dlsun1976 Backup level: 0 S/w compression: no Archive created: Wed Nov 09 14:57:42 2005 Dumping all files in /tmp /tmp/ /tmp/.X11-pipe/ /tmp/.X11-pipe/X0 ... /tmp/smc898/ /tmp/smc898/boot.pid Backup complete on Wed Nov 09 2005 at 14:58:01
Controlling Mount Point Behavior
Assume that the path /usr/dir1
contains a number of symbolic link files that point to files on a remote file system. For example, /usr/dir1/linkfile
is a symbolic link to /usr/dir2/data-file
, and /usr/dir2
is an NFS mount point.
Assume that you create a BDF named /tmp/example.bdf
with the following syntax:
+/usr/dir1
You specify the -h option, which indicates that obtar
should back up the data pointed to by the symbolic links, in the obtar -g
statement shown in Example 4-10.
In Example 4-10, obtar
will not back up the data pointed to by /usr/dir1/linkfile
because by default obtar
will not cross the /usr/dir2
mount point. Thus, the data in /usr/dir2/data-file
will not be backed up.
Assume that you alter the BDF so that it uses the following syntax:
+/usr/dir1 @crossremotemountpoints
You re-run the command shown in Example 4-10. In this case, obtar
will back up the data pointed to by /usr/dir1/linkfile
because the BDF directs obtar
to cross remote mount points in the /usr/dir1
file system. Because /usr/dir1/linkfile
points to /usr/dir2/data-file
, and /usr/dir2
mounts a remote file system, the data in /usr/dir2/data-file
will be backed up.
Now assume that you specify -h along with -l, which forces obtar
not to cross mount points regardless of other mount point options, in the obtar -g
statement shown in Example 4-11.
In Example 4-11, obtar
backs up the symbolic link files but not the files to which the links point to. This behavior results because the -l
option overrides the @crossremotemountpoints
statement in the BDF.
Restricting Backups to a File System
If your file system includes local or NFS mounts points, then obtar
ordinarily backs up any data that it can access through them. You can use the obtar -l
option to prevent obtar
from crossing mount points. For example, suppose the top-level directory of the host chicago
is mounted on the /home
directory of the host boston
. Your BDF specifies that all data in boston
's /home
directory should be backed up. In Example 4-12, obtar
backs up all the data in boston
's /home
directory as well as all the data on chicago
.
If you include the -l
option, as shown in Example 4-13, then obtar
backs up only the data in boston
's /home
directory.
If you explicitly specify an NFS mount point in a BDF, then obtar
backs up the data specified by that mount point whether you have used -l
or not.
Specifying a Backup Image Location with -F
When you are creating a backup image on a volume, obtar
ordinarily begins writing the backup image in the volume's current position. In some circumstances you may want to specify explicitly where obtar
should begin writing a new backup image. For example, suppose the backup fails, leaving the volume positioned in the middle of an unreadable backup image. When you redo the backup, you would want to specify that obtar
begin writing before the unreadable backup image.
You can use the -F
option to cause obtar
to write a backup image in a specified location. The command in Example 4-14 writes the backup image as backup image 3.
When obtar
creates a backup image at a specified volume position, the new backup image becomes the last backup image, even if the volume previously contained additional backup images. For example, if 11 backup images existed previously, and if you write backup image number 3, then you effectively erase images 4 through 11. If you use -F
cur
(or omit the option altogether), and if the volume is positioned at the beginning, then obtar
writes the new backup image as file 1 of a new volume, regardless of whether previous data is on the volume.
When you are using a volume set and specify -F end
or -F
file-number
, obtar
first positions the volume at the requested file within the volume set. If the file is on a volume different from the one currently loaded, then obtar
prompts you to make any required volume changes.