Use obtar -c to create a single backup image. You might use obtar -c to perform an on-demand backup or to back up data to a volume that you could transport to another site.
obtar -c [ -f device ] [ -H host ] [ -G ] [ -v [-v] ] [ -z ] { [ -C directory ] pathname... }...
You can specify a number of options with obtar -c; this section describes those options that you are most likely to use. Refer to "obtar Options" to learn about additional obtar -c options.
deviceSpecifies the name of a device. If you do not specify -f, then obtar writes to the device specified by the TAPE environment variable, if it is defined.
hostSpecifies the host on which the data to be backed up is located. If you do not specify -H, then obtar looks for the data on the local host.
Writes an index of the contents of the backup image to the catalog and generates a volume label. The catalog data includes the names of all the files and directories written to the backup image. obtool uses this information to find the backup image containing the data to be restored.
When you create backup images with obtar -c, obtar does not ordinarily generate the catalog files or volume identification that it does when you use obtar -g, although you can use -G to generate them.
Displays the path names of the files and directories being backed up. If you specify -v -v (or -vv), then obtar displays the path names of files and directories being backed up and their permissions, owner, size, and date of last modification.
directoryCauses obtar to change to the specified directory before backing up the subsequent files or directories. You use this option to control the path name information that is saved in the backup image.
pathnameSpecifies one or more files or directories to back up. obtar issues a warning message if the contents of a file that you have specified change while a backup is taking place.
The backup image you create includes data as well as path name information. When you restore the data, obtar uses pathname 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.
If pathname refers to data available through a mount of a local or remote file system, then obtar -c does not cross the mount point unless you specify -Xcrossmp.
You can also use the -C option to modify the pathname information that obtar records when you create the backup image.
To create a backup image on a volume, specify a device name with the -f option. Example 4-1 backs up the directory /doc to the volume loaded on the device tape0.
You can specify more than one directory or file to back up at a time. Example 4-2 backs up the file /jane/abc and the file /bob/xyz.
Changing Directory Information
You can use the -C option to control the path name information that is saved in the backup image. You use -C to specify the directory in which subsequent path names are located; obtar does not save that directory as part of the path name information in the backup image.
Example 4-3 backs up the directory /home/jane/current; it uses the -v option to display the path names of the data being backed up.
Example 4-3 Changing Directory Information
obtar -cv -f tape1 -C /home/jane current current/ current/file1 current/file2
As shown in the information displayed by the -v option, the path name information that obtar records in the backup image is the content of the relative path name current. When you subsequently restore the directory, unless you specify otherwise, obtar restores it to the directory named current, relative to your current directory.
Example 4-4 backs up the files /test/proj3/trial7/test1 and /test/proj3/trial7/test2.
Example 4-4 Changing Directory Information
obtar -cv -f /dev/nrwst1 -C /test/proj3 trial7/test1 trial7/test2 trial7/test1 trial7/test2
The path name information that obtar records in the backup image includes the relative path names trial7/test1 and trial7/test2. When you subsequently restore the files, unless you specify otherwise, obtar restores them to the directory trial7 in your current working directory (first creating trial7 if it does not exist).