]> git.wh0rd.org - dump.git/commitdiff
Added -a flag to restore (automatic walk through volumes)
authorStelian Pop <stelian@popies.net>
Wed, 16 Jan 2002 10:29:23 +0000 (10:29 +0000)
committerStelian Pop <stelian@popies.net>
Wed, 16 Jan 2002 10:29:23 +0000 (10:29 +0000)
CHANGES
restore/main.c
restore/restore.8.in
restore/restore.h
restore/tape.c

diff --git a/CHANGES b/CHANGES
index fb347681bff505a25426c2b8fa7d53927978484f..1e9bd77a62905934833130425faadcab0d9c53d6 100644 (file)
--- 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)
 =====================================================================
 
index 77ae96d1c466a2315a9cc8692b8c669c3a4a2d33..d0ca888b92be4da03b897bc46d2a1b0a00355be5 100644 (file)
@@ -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 <config.h>
@@ -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);
 }
 
index 7eb3b1da0fbe06f95703546d978d0600bdda6160..703111ef5b2afd8339f86354240a3569efc230d4 100644 (file)
@@ -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
index 6a929c2275c02f1c1fc6619533748f6d137cdbc9..ba6af080534c1a93cd696c89af5a9a07a1d9428a 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - AlcĂ´ve <www.alcove.com>, 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 */
index 76dded78fbef7113e3dc2740378fcc4392e59585..50d8a3e1daef9a10bd59c5527651855ca41d0a9a 100644 (file)
@@ -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 <config.h>
@@ -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 {