-/* $OpenBSD: dirs.c,v 1.12 1996/12/24 08:37:50 deraadt Exp $ */
+/* $OpenBSD: dirs.c,v 1.13 1997/04/16 04:07:35 millert Exp $ */
/* $NetBSD: dirs.c,v 1.16 1995/06/19 00:20:11 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)dirs.c 8.5 (Berkeley) 8/31/94";
#else
-static char rcsid[] = "$OpenBSD: dirs.c,v 1.12 1996/12/24 08:37:50 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: dirs.c,v 1.13 1997/04/16 04:07:35 millert Exp $";
#endif
#endif /* not lint */
#include <protocols/dumprestore.h>
#include <errno.h>
+#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <machine/endian.h>
-#include "pathnames.h"
#include "restore.h"
#include "extern.h"
-/* $OpenBSD: main.c,v 1.6 1997/01/15 23:41:38 millert Exp $ */
+/* $OpenBSD: main.c,v 1.7 1997/04/16 04:07:37 millert Exp $ */
/* $NetBSD: main.c,v 1.11 1996/03/15 22:39:39 scottr Exp $ */
/*
#include <err.h>
#include <errno.h>
+#include <paths.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "pathnames.h"
#include "restore.h"
#include "extern.h"
+++ /dev/null
-/* $OpenBSD: pathnames.h,v 1.2 1996/06/23 14:32:16 deraadt Exp $ */
-/* $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"
-.\" $OpenBSD: restore.8,v 1.5 1996/12/24 02:40:53 deraadt Exp $
+.\" $OpenBSD: restore.8,v 1.6 1997/04/16 04:07:39 millert Exp $
.\" $NetBSD: restore.8,v 1.11 1996/02/02 22:29:33 phil Exp $
.\"
.\" Copyright (c) 1985, 1991, 1993
.Nm restore
.Nd "restore files or file systems from backups made with dump"
.Sh SYNOPSIS
-.Nm restore
+.Nm
.Fl i
.Op Fl chmvy
.Op Fl b Ar blocksize
.Op Fl f Ar file
.Op Fl s Ar fileno
-.Nm restore
+.Nm
.Fl R
.Op Fl cvy
.Op Fl b Ar blocksize
.Op Fl f Ar file
.Op Fl s Ar fileno
-.Nm restore
+.Nm
.Fl r
.Op Fl cvy
.Op Fl b Ar blocksize
.Op Fl f Ar file
.Op Fl s Ar fileno
-.Nm restore
+.Nm
.Fl t
.Op Fl chvy
.Op Fl b Ar blocksize
.Op Fl f Ar file
.Op Fl s Ar fileno
.Op file ...
-.Nm restore
+.Nm
.Fl x
.Op Fl chmvy
.Op Fl b Ar blocksize
is not documented here.)
.Sh DESCRIPTION
The
-.Nm restore
+.Nm
command performs the inverse function of
.Xr dump 8 .
A full backup of a file system may be restored and
.It Fl i
This mode allows interactive restoration of files from a dump.
After reading in the directory information from the dump,
-.Nm restore
+.Nm
provides a shell like interface that allows the user to move
around the directory tree selecting files to be extracted.
The available commands are given below;
.Ic ls
command to list the inode numbers of all entries.
It also causes
-.Nm restore
+.Nm
to print out information about each file as it is extracted.
.El
.It Fl R
.Ed
.Pp
Note that
-.Nm restore
+.Nm
leaves a file
.Pa restoresymtable
in the root directory to pass information between incremental
If the
.Fl b
option is not specified,
-.Nm restore
+.Nm
tries to determine the block size dynamically.
.It Fl c
Normally,
-.Nm restore
+.Nm
will try to determine dynamically whether the dump was made from an
old (pre-4.4) or new format file sytem. The
.Fl c
.Ar file
may be a special device file
like
-.Pa /dev/rmt12
+.Pa /dev/rst0
(a tape drive),
.Pa /dev/rsd1c
(a disk drive),
.Dq host:file ,
or
.Dq user@host:file ,
-.Nm restore
+.Nm
reads from the named file on the remote host using
.Xr rmt 8 .
.Pp
File numbering starts at 1.
.It Fl v
Normally
-.Nm restore
+.Nm
does its work silently.
The
.Fl v
.Fl y
has been specified, or the user responds
.Ql y ,
-.Nm restore
+.Nm
will attempt to continue the restore.
.Pp
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.
If the
.Fl x
or
.Fl i
flag has been specified,
-.Nm restore
+.Nm
will also ask which volume the user wishes to mount.
The fastest way to extract a few files is to
start with the last volume, and work towards the first volume.
.Pp
.It resync restore, skipped <num> blocks
After a dump read error,
-.Nm restore
+.Nm
may have to resynchronize itself.
This message lists the number of blocks that were skipped over.
.El
.Sh FILES
.Bl -tag -width "./restoresymtable" -compact
-.It Pa /dev/rmt8
+.It Pa /dev/rst0
the default tape drive
.It Pa /dev/rst*
Raw SCSI tape interface
dumps that were made on active file systems.
.Pp
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;
thus a full dump must be done to get a new set of directories
reflecting the new inode numbering,
-even though the contents of the files is unchanged.
+even though the content of the files is unchanged.
.Pp
The temporary files
.Pa /tmp/rstdir*
operations shouldn't conflict with each other.
.Sh HISTORY
The
-.Nm restore
+.Nm
command appeared in
.Bx 4.2 .
-/* $OpenBSD: tape.c,v 1.7 1997/01/27 09:33:08 downsj Exp $ */
+/* $OpenBSD: tape.c,v 1.8 1997/04/16 04:07:40 millert Exp $ */
/* $NetBSD: tape.c,v 1.22 1996/11/30 18:31:29 cgd Exp $ */
/*
#include <protocols/dumprestore.h>
#include <errno.h>
+#include <paths.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include "restore.h"
#include "extern.h"
-#include "pathnames.h"
static long fssize = MAXBSIZE;
static int mt = -1;