From: Stelian Pop Date: Wed, 16 Jan 2002 10:29:23 +0000 (+0000) Subject: Added -a flag to restore (automatic walk through volumes) X-Git-Tag: release_0_4b27~10 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=40df6a0e578b56977f18c2a960f3fd30c4c78e60;p=dump.git Added -a flag to restore (automatic walk through volumes) --- diff --git a/CHANGES b/CHANGES index fb34768..1e9bd77 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.155 2002/01/11 08:54:12 stelian Exp $ +$Id: CHANGES,v 1.156 2002/01/16 10:29:23 stelian Exp $ Changes between versions 0.4b26 and 0.4b27 (released ???????????????) ===================================================================== @@ -12,6 +12,10 @@ Changes between versions 0.4b26 and 0.4b27 (released ???????????????) 3. Detailed the manual entry for the -N option of restore. +4. Added the -a flag to restore to make able doing unattended + restores in -i or -x mode (automatically walks through the + multiple dump volumes). + Changes between versions 0.4b25 and 0.4b26 (released January 7, 2002) ===================================================================== diff --git a/restore/main.c b/restore/main.c index 77ae96d..d0ca888 100644 --- a/restore/main.c +++ b/restore/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.34 2002/01/16 09:32:14 stelian Exp $"; + "$Id: main.c,v 1.35 2002/01/16 10:29:26 stelian Exp $"; #endif /* not lint */ #include @@ -80,7 +80,7 @@ static const char rcsid[] = #include "restore.h" #include "extern.h" -int bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0; +int aflag = 0, bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0; int hflag = 1, mflag = 1, Mflag = 0, Nflag = 0, Vflag = 0, zflag = 0; int uflag = 0, lflag = 0, Lflag = 0; int dokerberos = 0; @@ -154,7 +154,7 @@ main(int argc, char *argv[]) ; obsolete(&argc, &argv); while ((ch = getopt(argc, argv, - "b:CcdD:f:F:hi" + "ab:CcdD:f:F:hi" #ifdef KERBEROS "k" #endif @@ -164,6 +164,9 @@ main(int argc, char *argv[]) #endif "Rrs:tT:uvVxX:y")) != -1) switch(ch) { + case 'a': + aflag = 1; + break; case 'b': /* Change default tape blocksize. */ bflag = 1; @@ -393,6 +396,7 @@ main(int argc, char *argv[]) * Incremental restoration of a file system. */ case 'r': + aflag = 1; /* in -r or -R mode, -a is default */ setup(); if (dumptime > 0) { /* @@ -430,6 +434,7 @@ main(int argc, char *argv[]) * Resume an incremental file system restoration. */ case 'R': + aflag = 1; /* in -r or -R mode, -a is default */ initsymtable(symtbl); skipmaps(); skipdirs(); @@ -542,11 +547,11 @@ usage(void) (void)fprintf(stderr, "usage:\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n", __progname, " -C [-c" kerbflag "lMvVy] [-b blocksize] [-D filesystem] [-f file] [-F script] [-L limit] [-s fileno]", - __progname, " -i [-ch" kerbflag "lmMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno]", + __progname, " -i [-ach" kerbflag "lmMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno]", __progname, " -r [-c" kerbflag "lMuvVy] [-b blocksize] [-f file] [-F script] [-s fileno] [-T directory]", __progname, " -R [-c" kerbflag "lMuvVy] [-b blocksize] [-f file] [-F script] [-s fileno] [-T directory]", __progname, " -t [-ch" kerbflag "lMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]", - __progname, " -x [-ch" kerbflag "lmMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]"); + __progname, " -x [-ach" kerbflag "lmMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]"); exit(1); } diff --git a/restore/restore.8.in b/restore/restore.8.in index 7eb3b1d..703111e 100644 --- a/restore/restore.8.in +++ b/restore/restore.8.in @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: restore.8.in,v 1.21 2002/01/16 09:32:14 stelian Exp $ +.\" $Id: restore.8.in,v 1.22 2002/01/16 10:29:26 stelian Exp $ .\" .Dd __DATE__ .Dt RESTORE 8 @@ -50,7 +50,7 @@ .Op Fl T Ar directory .Nm restore .Fl i -.Op Fl chklmMNuvVy +.Op Fl achklmMNuvVy .Op Fl b Ar blocksize .Op Fl f Ar file .Op Fl F Ar script @@ -86,7 +86,7 @@ .Op file ... .Nm restore .Fl x -.Op Fl chklmMNuvVy +.Op Fl achklmMNuvVy .Op Fl b Ar blocksize .Op Fl f Ar file .Op Fl F Ar script @@ -301,6 +301,21 @@ option below. .Pp The following additional options may be specified: .Bl -tag -width Ds +.It Fl a +In +.Fl i +or +.Fl x +mode, +.Nm restore +does ask the user for the volume number on which the files to +be extracted are supposed to be (in order to minimise the time +be reading only the interesting volumes). The +.Fl a +option disables this behaviour and reads all the volumes starting +with 1. This option is useful when the operator does not know on which +volume the files to be extracted are and/or when he prefers the +longer unattended mode rather than the shorter interactive mode. .It Fl b Ar blocksize The number of kilobytes per dump record. If the diff --git a/restore/restore.h b/restore/restore.h index 6a929c2..ba6af08 100644 --- a/restore/restore.h +++ b/restore/restore.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - AlcĂ´ve , 2000-2002 * - * $Id: restore.h,v 1.22 2002/01/16 09:32:14 stelian Exp $ + * $Id: restore.h,v 1.23 2002/01/16 10:29:26 stelian Exp $ */ /* @@ -51,6 +51,7 @@ /* * Flags */ +extern int aflag; /* automatic volume increment */ extern int cvtflag; /* convert from old to new tape format */ extern int bflag; /* set input block size */ extern int dflag; /* print out debugging info */ diff --git a/restore/tape.c b/restore/tape.c index 76dded7..50d8a3e 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.52 2002/01/16 09:32:14 stelian Exp $"; + "$Id: tape.c,v 1.53 2002/01/16 10:29:26 stelian Exp $"; #endif /* not lint */ #include @@ -406,7 +406,7 @@ getvol(long nextvol) again: if (pipein) exit(1); /* pipes do not get a second chance */ - if (command == 'R' || command == 'r' || curfile.action != SKIP) { + if (aflag || curfile.action != SKIP) { newvol = nextvol; wantnext = 1; } else {