static char sccsid
[] = "@(#)main.c 3.16 (Berkeley) 85/03/24";
/* Copyright (c) 1983 Regents of the University of California */
* 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
int bflag
= 0, cvtflag
= 0, dflag
= 0, vflag
= 0, yflag
= 0;
int hflag
= 1, mflag
= 1;
char *inputdev
= "/dev/rmt8";
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
);