'\"macro stdmacro
.if n .pH g1a.ffile @(#)ffile	40.9 of 10/10/89
.\" Copyright 1989 AT&T
.ig
This file is for delivery to OAM9.
To be reviewed by Roger Massey.
..
'\"macro stdmacro
.nr X
.if \nX=0 .ds x} ffile 1M "System Administration Utilities" "\&"
.if \nX=1 .ds x} ffile 1M "System Administration Utilities"
.if \nX=2 .ds x} ffile 1M "" "\&"
.if \nX=2 .ds x} ffile "" "" "\&"
.TH \*(x}
.SH NAME
\f4ffile\f1 \- create, or restore from, a full file system archive
.SH SYNOPSIS
\f4ffile \-B \f1[\f4\-dlmortvAENSV\f1] \f2bkjobid ofsname ofsdev ofslab descript
.PP
\f4ffile \-RC \f1[\f4\-dlmortvAENSV\f1] \f2ofsname ofsdev refsname redev rsjobid descript
.PP
\f4ffile \-RF \f1[\f4\-dlmortvAENSV\f1] \f2ofsname ofsdev descript rsjobid:uid:date:type:name
.sp 0
\f1[:[\f2rename\fP]:[\f2inode\fP]] ...
.SH DESCRIPTION
The \f4ffile\fP command is invoked as a child process by other
shell commands.
The command name, \f4ffile\fP, is read either from the
\f4bkhist.tab\f1 file or the \f4bkreg \-m\f1 command and option.
The \f4 \-B, \-R, \-F, \f1and \f4\-C \f1options
are passed to \f4ffile\fP by
the shell commands \f4backup\fP, \f4restore\fP, and \f4urestore\f1.
The other options are passed from the
\f4bkhist.tab\f1 or the \f4bkreg \-p\f1 command and option.
The arguments are sent to \f4ffile\fP from various locations
in the backup service.
.PP
\f4ffile \-B\f1 is invoked as a child process by \f4bkdaemon\fP
to perform a full backup of the file system
.I ofsname
(the originating file system).
All files in
.I ofsname
are archived.
The resulting backup is created in
the format described on \f4cpio\fP(4).
The backup is recorded
in the backup history log, \f4/usr/oam/bkrs/tables/bkhist.tab\fP.
.PP
\f4ffile \-RC\f1 and \f4\RF\f1 are invoked as child processes by
\f4rsoper\fP to extract files from an full file system archive
created by \f4ffile \-B\f1.
The file system archive is assumed to be in
the format described on \f4cpio\fP(4).
.PP
If the \f4\-RC\f1 option is selected, the entire file system is restored.
.PP
If the \f4-RF\f1 option is specified,
only selected objects from the archive are restored.
Each 7-tuple, composed of
.IR rsjobid:uid:date:type:name:rename:inode ,
specifies an object to be restored from the file system archive.
The 7-tuple objects come to \f4ffile\fP from \f4rsstatus.tab\f1.
.P
The arguments to \f4ffile\fP are defined as follows:
.TP .7i
.I bkjobid
the job id assigned by \f4backup\fP.
The method uses the \f2bkjobid\f1 when it creates
history log and table-of-contents entries.
.TP
.I ofsname
the name of the file system that is to be backed up.
.TP
.I ofsdev
the name of the block special device on which the file system resides.
.TP
.I ofslab
the volume name on the file system [see \f4labelit\fP(1M)].
.TP
.I descript
is a description for a destination device in the form:
.sp.5
.nf
.I
	dgroup:dname:dchar:dlabels
.fi
.sp.5
.I dgroup
specifies a device group [see \f4devgroup.tab\fP(4)].
.br
\f2dname\fP
specifies a particular device name [see \f4device.tab\fP(4)].
.br
.I dchars
specifies characteristics associated with the device.
If specified, \f2dchar\f1 overrides the defaults for the specified
device and group.
[See \f4device.tab\fP(4)
for a further description of device characteristics.]
.br
.I dlabels
specifies the volume names for
the media to be used for reading or writing the archive.
.TP
.I refsname
if non-null,
the name of the file system to be restored to instead of
.IR ofsname .
At least one of
.I refsname
and
.I redev
must be null.
.TP
.I redev
if non-null, the partition to be restored to instead of
.IR ofsdev .
At least one of
.I refsname
and
.I redev
must be null.
.TP
.I rsjobid
the restore jobid assigned by
\f4restore\fP or \f4urestore\fP.
.TP
.I uid
the real uid of the user who requested the object to be restored.
It must match the uid of the owner of the object at the
time the archive was made, or it must be the superuser uid.
.TP
.I date
the newest "last modification time" that is acceptable for a restorable
object.
The object is restored from the archive immediately
older than this date.
.I date
is a hexadecimal representation of the date and time provided
by the \f4time\fP system call [see \f4time\fP(2)].
.TP
.I type
either \f4F\fP or \f4D\fP,
indicating that the object is a file or a directory,
respectively.
.TP
.I name
the name the object had in the file system archive.
.TP
\f2rename\fP
the name that the object should be restored to (it may differ
from the name the object had in the file system archive).
If omitted, the object is restored to
.I name.
.TP
\f2inode\fP
the inode number of the object as it was stored in the file system
archive.
.I [inode]
is not used by
\f4ffile \-R\f1,
and is provided only for command-line compatibility with
other restoration methods.
.SS Options
Some options are only significant during
\f4ffile \-B\f1 invocations;  they are accepted but ignored
during \f4ffile \-R\f1 invocations because the command is
invoked and options are specified automatically by \f4restore\fP.
These options are flagged with an asterisk (*).
.TP 10
\f4d*\f1
Inhibits recording of the archive in the backup history log.
.TP 10
\f4l*\f1
Creates a long form of the backup history log that includes a table-of-contents
for the archive.
This includes the data used to generate a
listing of each file in the archive (like that produced by the
\f4ls \-l\fP command).
.TP 10
\f4m*\f1
Mounts the originating file system read-only before starting the backup
and remounts it with its original permissions after completing the backup.
Cannot be used with \f4root\f1 or \f4/usr\f1 file systems.
.TP 10
\f4o\f1
Permits the user to override media insertion requests [see
\f4getvol\fP(1M) and the description of the \f4\-o\fP option].
.TP 10
\f4r*\f1
Includes remotely mounted resources in the archive.
.TP 10
\f4t*\f1
Creates a table of contents for the backup on additional media instead of
in the backup history log.
.TP 10
\f4v*\f1
Validates the archive as it is written.
A checksum is computed as the archive is being written;
as each medium is completed, it is re-read and the checksum
recomputed to verify that each block is readable and correct.
If either check fails, the medium is considered unreadable.
If \f4\-A\f1 has been specified, the archiving operation fails;
otherwise, the operator is prompted to replace the failed medium.
.TP 10
\f4A\f1
Establishes automated mode,
(i.e., does not prompt the user to insert or remove media).
.TP 10
\f4E*\f1
Reports an estimate of media usage for the archive;
then performs the backup.
.TP 10
\f4N*\f1
Reports an estimate of media usage for the archive;
does not perform the backup.
.TP 10
\f4S\f1
Displays
a period (.) for every 100 (512 byte) blocks read-from or written-to
the archive on the destination device.
.TP 10
\f4V\f1
Displays
the name of each file written-to or extracted-from
the archive on the destination device.
.SS User Interactions
The connection between an archiving method and
\f4backup\fP is more complex than a simple fork/exec or pipe.
The \f4backup\fP command
is responsible for all interactions with the user,
either directly, or through \f4bkoper\fP.
Therefore, \f4ffile\fP
neither reads from standard-input nor writes to standard-output or
standard-error.
A method library must be used [see \f4libbrmeth\fP(3)]
to communicate reports (estimates, filenames, periods, status, etc.)
to \f4backup\fP.
.SH DIAGNOSTICS
The exit codes for \f4ffile\fP are the following:
.PD 0
.TP 5
0
successful completion of the task
.TP
1
one or more parameters to \f4ffile\fP are invalid.
.TP
2
an error has occurred which caused \f4ffile\fP to fail to
complete all portions of its task.
.PD
.SH FILES
.PD 0
.TP 1.75i
\f4/usr/oam/bkrs/tables/bkexcept.tab\fP
lists the files that are to be excluded from an
incremental file system backup.
.TP
\f4/usr/oam/bkrs/tables/bkhist.tab\fP
lists the labels of all volumes that have been used for backup operations.
.TP
\f4/usr/oam/bkrs/tables/rsstatus.tab\fP
tracks the status ofall restore requests from users.
.TP
\f4/usr/oam/bkrs/logs/bklog\fP
logs errors generated by the backup methods and the \f4backup\f1 command
.TP
\f4/usr/oam/bkrs/logs/rslog\fP
logs errors generated by the restore methods and the \f4restore\f1 command
.TP
\f4$TMP/filelist$$\fP
temporarily stores a table of contents for a backup archive.
.PD
.SH SEE ALSO
\f4backup\fP(1M),
\f4bkoper\fP(1M)
\f4cpio\fP(1), \f4cpio\fP(4),
\f4device.tab\fP(4),
\f4fdp\fP(1),
\f4ffile\fP(1),
\f4fimage\fP(1),
\f4getvol\fP(1M),
\f4incfile\fP(1),
\f4labelit\fP(1M),
\f4libbrmeth\fP(3),
\f4ls\fP(1),
\f4restore\fP(1M),
\f4rsoper\fP(1M),
\f4time\fP(2),
\f4urestore\fP(1)


