'\"macro stdmacro
.if n .pH g1a.restore @(#)restore @(#)restore	40.14.1.2 of 1/17/90
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} restore 1M "System Administration Utilities" "\&"
.if \nX=1 .ds x} restore 1M "System Administration Utilities"
.if \nX=2 .ds x} restore 1M "" "\&"
.if \nX=3 .ds x} restore "" "" "\&"
.TH \*(x}
.SH NAME
\f4restore\f1 \- initiate restores of filesystems, data partitions, or disks
.SH SYNOPSIS
.P
\f4restore\f1
[\f4\-o \f2target\f1]
[\f4\-d \f2date\f1]
[\f4\-mn\f1]
[\f4\-s|v\f1]
\f4\-P \f2partdev\f1
.P
\f4restore\f1
[\f4\-o \f2target\f1]
[\f4\-d \f2date\f1]
[\f4\-mn\f1]
[\f4\-s|v\f1]
\f4\-S \f2odevice
.P
\f4restore\f1
[\f4\-o \f2target\f1]
[\f4\-d \f2date\f1]
[\f4\-mn\f1]
[\f4\-s|v\f1]
\f4\-A \f2partdev\f1
.SH DESCRIPTION
\f4restore\fP
posts requests for the restore of a data partition,
a filesystem partition, or a disk from system-maintained archives.
If the appropriate archive containing the required partition
is online, the partition is restored immediately.
If not, a request to restore the specified archive of the partition
is posted to a restore status table.
The restore status table is
\f4/etc/bkup/rsstatus.tab\fP.
The restore request is assigned a
\f4restore\fP jobid 
that can be used to monitor the progress
of the restore or to cancel it.
A restore request that has been posted must later be
resolved by an operator (see
\f4rsoper\f1(1M)).
.P
\f4restore\fP
may be executed only by a user with superuser privilege.
.P
If \f4restore \-A \f2partdev\f1 is issued, 
the \f4fdisk\f1(1M) (full disk recovery) method
is used to repartition and repopulate disk
.I partdev.
.I partdev
is the name of the device that refers to the entire disk.
For the \s-1AT&T 3B2\s+1, it is
\f4/dev/rdsk/c1d?s6\f1.
.SS Options
.TP 10
\f4\-d \f2date\f1
Restores the partition as of
.IR date .
This may or may not be the latest archive.
See
\f4getdate\f1(1M)
for valid date formats.
.TP 10
\f4\-m\f1
If the restore cannot be carried out immediately,
this option notifies the invoking user 
(via \f4mail\f1(1M))
when the request has been completed.
.TP 10
\f4\-n\f1
Displays a list of all archived versions of the object
contained in the backup history log,
but does not attempt to restore the object.
.TP 10
\f4\-o \f2target\f1
Instead of restoring directly to the specified object
.RI ( partdev
or
.IR fsdev ),
this option restores the archive to
.IR target .
.I target
is of the form:
.nf
	\f1[\f2oname\f1][\f4:\f2odev\f1]
.fi
where
.I oname
is the name of the filesystem to be restored to (for
\f4\-S\f1
archives) and
.I odev
is the name of the partition to be restored to (for
\f4\-P\f1
and
\f4\-A\f1
archives).
.TP 10
\f4\-s\f1
While a restore operation is occurring,
displays a ``.'' for each 100 (512-byte) blocks 
transferred from the destination device.
.TP 10
\f4\-v\f1
Displays the name of each object as it is restored.
Only those archiving methods that restore named directories
and files (\f4incfile, ffile\fP) support this option.
.TP 10
\f4\-A \f2partdev\f1
Initiates restore of the entire disk \f2 partdev\f1.
.TP 10
\f4\-P \f2partdev\f1
Initiates restore of the
data partition
.IR partdev .
.TP 10
\f4\-S \f2odevice\f1
Initiates restore of the filesystem partition
.IR odevice.
.SH DIAGNOSTICS
The exit codes for \f4restore\fP are the following:
.PP
0 = the task completed successfully
.br
1 = one or more parameters to \f4restore\fP are invalid
.br
2 = an error has occurred, causing \f4restore\fP to fail to
      complete \f2all\f1 portions of its task
.SH EXAMPLES
.P
Example 1:
.P
.in 1.0i
\f4restore \-m \-S /usr\fP
.in 0
.P
posts a request to restore the most
current archived version of \f4/usr\f1.
If the restore cannot
be carried out immediately, notify the invoking user
when the request has been completed.
.P
Example 2:
.P
.in 1.0i
\f4restore \-o /dev/rdsk/c1d0s8 \-P /dev/rdsk/c1d1s2\fP
.in 0
.P
posts a request that the archived data partition
\f4/dev/rdsk/c1d1s2\fP be restored
to the target device partition 
\f4/dev/rdsk/c1d0s8\fP.
.P
Example 3:
.P
.in 1.0i
\f4restore \-d "december 1, 1987" \-A /dev/rdsk/c1d0s6\fP
.in 0
.P
posts a request for the restore of the entire disk
\f2/dev/rdsk/c1d0s6\f1.
The restore should be made as of December 1, 1987.
.P
Example 4:
.P
.in 1.0i
\f4restore \-n \-P /dev/rdsk/c1d0s1\fP
.in 0
.P
requests the system to display
the backup date and an \f4ls -l\f1 listing
from the backup history log
of all archived versions of the data partition 
\f4/dev/rdsk/c1d0s1\fP.
The data partition is not restored.
.SH FILES
.TP 1.75i
\f4/etc/bkup/bkhist.tab\fP
lists the labels of all volumes that have been used for
backup operations
.TP 1.75i
\f4/etc/bkup/rsstatus.tab\fP
lists the status of all restore requests from users
.TP 1.75i
\f4/etc/bkup/rsnotify.tab\fP
lists the email address of the operator to be 
notified whenever restore requests require operator intervention
.SH SEE ALSO
.na
\f4fdisk\fP(1M),
\f4mail\fP(1M), 
\f4rsnotify\fP(1M),
\f4rsoper\fP(1M), 
\f4rsstatus\fP(1M), 
\f4urestore\fP(1M), 
\f4ursstatus\fP(1M).
.br
\f4getdate\fP(3C) in the 
\f2Programmer's Reference Manual\f1.

