restore(1) CLIX restore(1)
NAME
restore - Restores an incremental file system
SYNOPSIS
/etc/restore key [name ... ]
FLAGS
i Allows files to be interactively restored from a backup tape. After
reading the directory information from the tape, restore command
provides a shell-like interface that allows the user to move around
the directory tree, selecting files to be extracted. The available
commands follow; for the commands that require an argument, the
default is the current directory.
ls [dir] Lists the current or specified directory. Entries that
are directories are appended with a ``/''. Entries
that have been marked for extraction are prepended with
a ``*''. If the verbose flag is set, the inode number
of each entry is also listed.
cd dir Changes the current working directory to the specified
argument.
pwd Displays the full pathname of the current working
directory.
add [arg] Adds the current directory or specified argument to the
list of files to be extracted. If a directory is
specified, it and all its descendants are added to the
extraction list (unless the h flag is specified on the
command line). Files on the extraction list are
prepended with a ``*'' when they are listed by ls.
delete [arg] Deletes the current directory or specified argument
from the list of files to be extracted. If a directory
is specified, it and all its descendants are deleted
from the extraction list (unless the h flag is
specified on the command line). The most expedient way
to extract most files from a directory is to add the
directory to the extraction list and then delete the
files that are not needed.
extract Extracts all files on the extraction list from the
backup tape. The restore command asks which volume the
user wishes to mount. The fastest way to extract a few
files is to start with the last volume and work toward
the first volume.
2/94 - Intergraph Corporation 1
restore(1) CLIX restore(1)
setmodes Sets owner, modes, and times for all directories added
to the extraction list. Nothing is extracted from the
tape. This is useful for cleaning up after a restore
has been prematurely aborted.
verbose Toggles the sense of the v flag. When set, the verbose
flag causes the ls command to list the inode numbers of
all entries. It also causes restore to display
information about each file as it is extracted.
help Lists a summary of the available commands.
quit Immediately exits the restore command, even if the
extraction list is not empty.
R Requests a particular tape of a multivolume set to restart a full
restore (see the r flag). This allows restore to be interrupted and
then restarted.
r Reads the tape and loads it to the current directory. This should not
be done lightly; the r flag should only be used to restore a complete
backup tape on a clear file system or to restore an incremental backup
tape after a full-level 0 restore. The following is a typical
sequence to restore a complete backup:
mkfs 3000 /dev/dsk/s0u0p7.4
mount /dev/dsk/s0u0p7.4 /mnt
cd /mnt
restore r
Another restore can be done to put an incremental backup on top of
this. Note that restore leaves a file restoresymtab in the root
directory to pass information between incremental restore passes.
This file should be removed when the last incremental tape has been
restored.
A backup followed by an mkfs command and a restore command is used to
change the size of a file system.
t Lists the names of the specified files if they occur on the tape. If
no file argument is given, the root directory is listed, which results
in the entire contents of the tape being listed unless the h flag has
been specified.
x Extracts the named files from the tape. If the named file matches a
directory whose contents were written to the tape and the h flag is
not specified, the directory is recursively extracted. The owner,
modification time, and mode are restored (if possible). If no file
argument is given, the root directory is extracted, which results in
the entire contents of the tape being extracted unless the h flag was
specified.
2 Intergraph Corporation - 2/94
restore(1) CLIX restore(1)
The following function modifier flags may be used in addition to the
function selection flags previously described:
b The next argument to restore is used as the block size of the tape (in
kilobytes). If the b flag is not specified, restore tries to
determine the tape block size dynamically.
f The next argument to restore is used as the name of the archive
instead of /dev/rmt/0m. The rtc command can be used to restore tapes
from a remote tape device. If the name of the file is ``-'', restore
reads from stdin. Thus, backup and restore can be used in a pipeline
to backup and restore a file system with the following command:
backup 0f - /usr | (cd /mnt; restore xf -)
h The restore command extracts the actual directory, rather than the
files that it references. This prevents hierarchical restoration of
complete subtrees from the tape.
m The restore command extracts by inode numbers rather than by filename.
This is useful if only a few files are being extracted, to avoid
regenerating the complete pathname to the file.
s The next argument to restore is a number that selects the file on a
multifile backup tape. File numbering starts at 1.
v Normally, restore works silently. The v (verbose) flag causes it to
display the name of each file it treats, preceded by its file type.
y The restore command does ask whether it should abort the restore if it
gets a tape error. It tries to skip the bad tape block(s) and
continue.
DESCRIPTION
The restore command reads tapes backed up with the backup command. Its
actions are controlled by the key argument. The key is a string of
characters containing at most one function flag and possibly one or more
function modifiers (also flags). Other arguments to the command are file
or directory names specifying the files to be restored. Unless the h flag
is specified, the appearance of a directory name refers to the files and
(recursively) subdirectories of that directory.
EXAMPLES
1. The following example restores a full backup into the current
directory:
$ restore rf /dev/rmt/mt6 > restore.log 2>&1
2/94 - Intergraph Corporation 3
restore(1) CLIX restore(1)
2. The following example restores a file from a backup tape:
$ restore xf errlog.old /dev/rmt/mt6
FILES
/dev/rmt/0m
The default tape drive
/tmp/rstdir*
File containing directories on the tape
/tmp/rstmode*
Owner, mode, and time stamps for directories
./restoresymtab
Information passed between incremental restorations
NOTES
The restore command can become confused when performing incremental
restores from backup tapes made on active file systems.
A level zero backup must be performed after a full restore. Because
restore runs in user code, it cannot control inode allocation; thus, a
full restore must be performed to get a new set of directories. These
directories reflect the new inode numbering even though the file contents
are unchanged.
DIAGNOSTICS
The program complains about bad key flags.
The program complains if it gets a read error. If y has been specified or
the user responds with y, restore attempts to continue the restore.
If the backup extends over more than one tape, restore asks the user to
change tapes. If the x or i flag has been specified, restore also asks
which volume the user wishes to mount. The fastest way to extract a few
files is to start with the last volume and work toward the first volume.
Numerous consistency checks can be listed by restore. Most checks are
self-explanatory or can ``never happen.'' Common errors are as follows:
Filename: not found on tape
The specified filename was listed in the tape directory, but was
not found on the tape. This is caused by tape read errors while
looking for the file and from using a backup tape created on an
active file system.
4 Intergraph Corporation - 2/94
restore(1) CLIX restore(1)
Expected next file inumber, got inumber
A file that was not listed in the directory appeared. This can
occur when using a backup tape created on an active file system.
Incremental tape too low
When performing an incremental restoration, a tape that was written
before the previous incremental tape, or that has an incremental
level that is too low, was loaded.
Incremental tape too high
When performing an incremental restoration, a tape that does not
begin its coverage where the previous incremental tape left off, or
that has an incremental level that is too high, was loaded.
Tape read error while restoring filename
Tape read error while skipping over inode inumber
Tape read error while trying to resynchronize
A tape read error occurred. If a filename is specified, its
contents are probably partially wrong. If an inode is being
skipped or the tape is trying to resynchronize, no extracted files
have been corrupted, though files may not be found on the tape.
Resync restore, skipped num blocks
After a tape read error, restore may need resynchronization. This
message lists the number of blocks that were skipped.
Cannot restore FFS from a pipe (use restoreffs)
The restore program must be run as restoreffs to restore a Fast
File System (FFS) from piped input. When restoring from a file,
restore works for any file system.
EXIT VALUES
The restore command exits with a value of 0 if successful and a value of 1
if a problem is encountered.
RELATED INFORMATION
Commands: backup(1), rtc(1), newfs(8), mount(8), mkfs
2/94 - Intergraph Corporation 5