* Copyright (c) 1983 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
"@(#) Copyright (c) 1983 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)main.c 5.6 (Berkeley) %G%";
* Modified to recursively extract all files within a subtree
* (supressed by the h option) and recreate the heirarchical
* structure of that subtree and move extracted files to their
* proper homes (supressed by the m option).
* Includes the s (skip files) option for use with multiple
* dumps on a single tape.
* 8/29/80 by Mike Litzkow
* Modified to work on the new file system and to recover from
* 1/19/82 by Kirk McKusick
* Full incremental restore running entirely in user code and
* interactive tape browser.
* 1/19/83 by Kirk McKusick
#include <protocols/dumprestore.h>
int bflag
= 0, cvtflag
= 0, dflag
= 0, vflag
= 0, yflag
= 0;
int hflag
= 1, mflag
= 1, Nflag
= 0;
char *inputdev
= _PATH_DEFTAPE
;
char *symtbl
= "./restoresymtable";
if (signal(SIGINT
, onintr
) == SIG_IGN
)
(void) signal(SIGINT
, SIG_IGN
);
if (signal(SIGTERM
, onintr
) == SIG_IGN
)
(void) signal(SIGTERM
, SIG_IGN
);
fprintf(stderr
, "Usage:\n%s%s%s%s%s",
"\trestore tfhsvy [file file ...]\n",
"\trestore xfhmsvy [file file ...]\n",
for (cp
= *argv
++; *cp
; cp
++) {
fprintf(stderr
, "missing device specifier\n");
* change default tape blocksize
fprintf(stderr
, "missing block size\n");
fprintf(stderr
, "Block size must be a positive integer\n");
* dumpnum (skip to) for multifile dump tapes
fprintf(stderr
, "missing dump number\n");
fprintf(stderr
, "Dump number must be a positive integer\n");
"%c and %c are mutually exclusive\n",
fprintf(stderr
, "Bad key character %c\n", *cp
);
fprintf(stderr
, "must specify i, t, r, R, or x\n");
* Incremental restoration of a file system.
* This is an incremental dump tape.
vprintf(stdout
, "Begin incremental restore\n");
vprintf(stdout
, "Calculate node updates.\n");
treescan(".", ROOTINO
, nodeupdates
);
* This is a level zero dump tape.
vprintf(stdout
, "Begin level 0 restore\n");
vprintf(stdout
, "Calculate extraction list.\n");
treescan(".", ROOTINO
, nodeupdates
);
vprintf(stdout
, "Verify the directory structure\n");
treescan(".", ROOTINO
, verifyfile
);
dumpsymtable(symtbl
, (long)1);
* Resume an incremental file system restoration.
dumpsymtable(symtbl
, (long)1);
treescan(name
, ino
, listfile
);
* Batch extraction of tape contents.
treescan(name
, ino
, addfile
);