use _PATH_DEFTAPE from <paths.h> instead of "pathnames.h"

cleanup references/examples to use /dev/rst* instead of /dev/rmt*
minor .Nm usage cleanup in man page
This commit is contained in:
lukem 1997-04-15 07:12:19 +00:00
parent ac4989250c
commit ceb1313a6a
5 changed files with 33 additions and 76 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dirs.c,v 1.22 1997/03/19 08:42:51 lukem Exp $ */ /* $NetBSD: dirs.c,v 1.23 1997/04/15 07:12:19 lukem Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@ -42,7 +42,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)dirs.c 8.5 (Berkeley) 8/31/94"; static char sccsid[] = "@(#)dirs.c 8.5 (Berkeley) 8/31/94";
#else #else
static char rcsid[] = "$NetBSD: dirs.c,v 1.22 1997/03/19 08:42:51 lukem Exp $"; static char rcsid[] = "$NetBSD: dirs.c,v 1.23 1997/04/15 07:12:19 lukem Exp $";
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -57,6 +57,7 @@ static char rcsid[] = "$NetBSD: dirs.c,v 1.22 1997/03/19 08:42:51 lukem Exp $";
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <errno.h> #include <errno.h>
#include <paths.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -64,7 +65,6 @@ static char rcsid[] = "$NetBSD: dirs.c,v 1.22 1997/03/19 08:42:51 lukem Exp $";
#include <machine/endian.h> #include <machine/endian.h>
#include "pathnames.h"
#include "restore.h" #include "restore.h"
#include "extern.h" #include "extern.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.11 1996/03/15 22:39:39 scottr Exp $ */ /* $NetBSD: main.c,v 1.12 1997/04/15 07:12:21 lukem Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@ -43,7 +43,7 @@ static char copyright[] =
#if 0 #if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 9/13/94"; static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 9/13/94";
#else #else
static char rcsid[] = "$NetBSD: main.c,v 1.11 1996/03/15 22:39:39 scottr Exp $"; static char rcsid[] = "$NetBSD: main.c,v 1.12 1997/04/15 07:12:21 lukem Exp $";
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -56,12 +56,12 @@ static char rcsid[] = "$NetBSD: main.c,v 1.11 1996/03/15 22:39:39 scottr Exp $";
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <paths.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "pathnames.h"
#include "restore.h" #include "restore.h"
#include "extern.h" #include "extern.h"

View File

@ -1,45 +0,0 @@
/* $NetBSD: pathnames.h,v 1.6 1995/03/18 14:59:48 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.2 (Berkeley) 1/21/94
*/
#include <paths.h>
#define _PATH_DEFTAPE "/dev/rmt8"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: restore.8,v 1.13 1996/12/24 02:32:25 mikel Exp $ .\" $NetBSD: restore.8,v 1.14 1997/04/15 07:12:23 lukem Exp $
.\" .\"
.\" Copyright (c) 1985, 1991, 1993 .\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -80,7 +80,7 @@ option syntax is implemented for backward compatibility, but
is not documented here.) is not documented here.)
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm restore .Nm
command performs the inverse function of command performs the inverse function of
.Xr dump 8 . .Xr dump 8 .
A full backup of a file system may be restored and A full backup of a file system may be restored and
@ -88,7 +88,7 @@ subsequent incremental backups layered on top of it.
Single files and Single files and
directory subtrees may be restored from full or partial directory subtrees may be restored from full or partial
backups. backups.
.Nm Restore .Nm
works across a network; works across a network;
to do this see the to do this see the
.Fl f .Fl f
@ -106,7 +106,7 @@ Exactly one of the following flags is required:
.It Fl i .It Fl i
This mode allows interactive restoration of files from a dump. This mode allows interactive restoration of files from a dump.
After reading in the directory information from the dump, After reading in the directory information from the dump,
.Nm restore .Nm
provides a shell like interface that allows the user to move provides a shell like interface that allows the user to move
around the directory tree selecting files to be extracted. around the directory tree selecting files to be extracted.
The available commands are given below; The available commands are given below;
@ -140,7 +140,7 @@ those files that are not needed.
.It Ic extract .It Ic extract
All the files that are on the extraction list are extracted All the files that are on the extraction list are extracted
from the dump. from the dump.
.Nm Restore .Nm
will ask which volume the user wishes to mount. will ask which volume the user wishes to mount.
The fastest way to extract a few files is to The fastest way to extract a few files is to
start with the last volume, and work towards the first volume. start with the last volume, and work towards the first volume.
@ -170,11 +170,11 @@ When set, the verbose flag causes the
.Ic ls .Ic ls
command to list the inode numbers of all entries. command to list the inode numbers of all entries.
It also causes It also causes
.Nm restore .Nm
to print out information about each file as it is extracted. to print out information about each file as it is extracted.
.El .El
.It Fl R .It Fl R
.Nm Restore .Nm
requests a particular tape of a multi volume set on which to restart requests a particular tape of a multi volume set on which to restart
a full restore a full restore
(see the (see the
@ -207,7 +207,7 @@ restore rf /dev/rst8
.Ed .Ed
.Pp .Pp
Note that Note that
.Nm restore .Nm
leaves a file leaves a file
.Pa restoresymtable .Pa restoresymtable
in the root directory to pass information between incremental in the root directory to pass information between incremental
@ -215,7 +215,7 @@ restore passes.
This file should be removed when the last incremental has been This file should be removed when the last incremental has been
restored. restored.
.Pp .Pp
.Nm Restore , .Nm restore ,
in conjunction with in conjunction with
.Xr newfs 8 .Xr newfs 8
and and
@ -264,11 +264,11 @@ The number of kilobytes per dump record.
If the If the
.Fl b .Fl b
option is not specified, option is not specified,
.Nm restore .Nm
tries to determine the block size dynamically. tries to determine the block size dynamically.
.It Fl c .It Fl c
Normally, Normally,
.Nm restore .Nm
will try to determine dynamically whether the dump was made from an will try to determine dynamically whether the dump was made from an
old (pre-4.4) or new format file sytem. The old (pre-4.4) or new format file sytem. The
.Fl c .Fl c
@ -280,7 +280,7 @@ Read the backup from
.Ar file .Ar file
may be a special device file may be a special device file
like like
.Pa /dev/rmt12 .Pa /dev/rst0
(a tape drive), (a tape drive),
.Pa /dev/rsd1c .Pa /dev/rsd1c
(a disk drive), (a disk drive),
@ -292,7 +292,7 @@ If the name of the file is of the form
.Dq host:file , .Dq host:file ,
or or
.Dq user@host:file , .Dq user@host:file ,
.Nm restore .Nm
reads from the named file on the remote host using reads from the named file on the remote host using
.Xr rmt 8 . .Xr rmt 8 .
.Pp .Pp
@ -313,7 +313,7 @@ on a multi-file tape.
File numbering starts at 1. File numbering starts at 1.
.It Fl v .It Fl v
Normally Normally
.Nm restore .Nm
does its work silently. does its work silently.
The The
.Fl v .Fl v
@ -330,18 +330,18 @@ If
.Fl y .Fl y
has been specified, or the user responds has been specified, or the user responds
.Ql y , .Ql y ,
.Nm restore .Nm
will attempt to continue the restore. will attempt to continue the restore.
.Pp .Pp
If a backup was made using more than one tape volume, If a backup was made using more than one tape volume,
.Nm restore .Nm
will notify the user when it is time to mount the next volume. will notify the user when it is time to mount the next volume.
If the If the
.Fl x .Fl x
or or
.Fl i .Fl i
flag has been specified, flag has been specified,
.Nm restore .Nm
will also ask which volume the user wishes to mount. will also ask which volume the user wishes to mount.
The fastest way to extract a few files is to The fastest way to extract a few files is to
start with the last volume, and work towards the first volume. start with the last volume, and work towards the first volume.
@ -389,13 +389,13 @@ though files may not be found on the tape.
.Pp .Pp
.It resync restore, skipped <num> blocks .It resync restore, skipped <num> blocks
After a dump read error, After a dump read error,
.Nm restore .Nm
may have to resynchronize itself. may have to resynchronize itself.
This message lists the number of blocks that were skipped over. This message lists the number of blocks that were skipped over.
.El .El
.Sh FILES .Sh FILES
.Bl -tag -width "./restoresymtable" -compact .Bl -tag -width "./restoresymtable" -compact
.It Pa /dev/rmt8 .It Pa /dev/rst0
the default tape drive the default tape drive
.It Pa /dev/rst* .It Pa /dev/rst*
Raw SCSI tape interface Raw SCSI tape interface
@ -412,12 +412,14 @@ information passed between incremental restores.
.Xr mount 8 , .Xr mount 8 ,
.Xr rmt 8 .Xr rmt 8
.Sh BUGS .Sh BUGS
.Nm Restore .Nm
can get confused when doing incremental restores from can get confused when doing incremental restores from
dumps that were made on active file systems. dumps that were made on active file systems.
.Pp .Pp
A level zero dump must be done after a full restore. A level zero dump must be done after a full restore.
Because restore runs in user code, Because
.Nm
runs in user code,
it has no control over inode allocation; it has no control over inode allocation;
thus a full dump must be done to get a new set of directories thus a full dump must be done to get a new set of directories
reflecting the new inode numbering, reflecting the new inode numbering,
@ -446,6 +448,6 @@ have two different dumps started at the same time, and separate
operations shouldn't conflict with each other. operations shouldn't conflict with each other.
.Sh HISTORY .Sh HISTORY
The The
.Nm restore .Nm
command appeared in command appeared in
.Bx 4.2 . .Bx 4.2 .

View File

@ -1,4 +1,4 @@
/* $NetBSD: tape.c,v 1.25 1997/03/19 08:42:55 lukem Exp $ */ /* $NetBSD: tape.c,v 1.26 1997/04/15 07:12:25 lukem Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@ -42,7 +42,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)tape.c 8.6 (Berkeley) 9/13/94"; static char sccsid[] = "@(#)tape.c 8.6 (Berkeley) 9/13/94";
#else #else
static char rcsid[] = "$NetBSD: tape.c,v 1.25 1997/03/19 08:42:55 lukem Exp $"; static char rcsid[] = "$NetBSD: tape.c,v 1.26 1997/04/15 07:12:25 lukem Exp $";
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -56,6 +56,7 @@ static char rcsid[] = "$NetBSD: tape.c,v 1.25 1997/03/19 08:42:55 lukem Exp $";
#include <protocols/dumprestore.h> #include <protocols/dumprestore.h>
#include <errno.h> #include <errno.h>
#include <paths.h>
#include <setjmp.h> #include <setjmp.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -64,7 +65,6 @@ static char rcsid[] = "$NetBSD: tape.c,v 1.25 1997/03/19 08:42:55 lukem Exp $";
#include "restore.h" #include "restore.h"
#include "extern.h" #include "extern.h"
#include "pathnames.h"
static long fssize = MAXBSIZE; static long fssize = MAXBSIZE;
static int mt = -1; static int mt = -1;