From: Stelian Pop Date: Thu, 16 Aug 2001 09:37:57 +0000 (+0000) Subject: Makes dump abort (-q option) whenever it needs operator attention. X-Git-Tag: release_0_4b24~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e084ba00f03da98a6d260b0b3856aee2dfbb4c58;p=dump.git Makes dump abort (-q option) whenever it needs operator attention. --- diff --git a/CHANGES b/CHANGES index 72a61c3..204f3eb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.131 2001/08/14 13:11:58 stelian Exp $ +$Id: CHANGES,v 1.132 2001/08/16 09:37:57 stelian Exp $ Changes between versions 0.4b23 and 0.4b24 (released ?????????????) =================================================================== @@ -13,6 +13,10 @@ Changes between versions 0.4b23 and 0.4b24 (released ?????????????) a compare (since it changes the working directory to the filesystem being compared in the process). +4. Added the -q option to dump which makes dump abort + whenever it needs operator attention. It should be + easier to use dump in scripts with this option. + Changes between versions 0.4b22 and 0.4b23 (released July 20, 2001) =================================================================== diff --git a/dump/dump.8.in b/dump/dump.8.in index abbda73..206356b 100644 --- a/dump/dump.8.in +++ b/dump/dump.8.in @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dump.8.in,v 1.30 2001/07/19 09:03:44 stelian Exp $ +.\" $Id: dump.8.in,v 1.31 2001/08/16 09:37:59 stelian Exp $ .\" .Dd __DATE__ .Dt DUMP 8 @@ -40,7 +40,7 @@ .Nd ext2 filesystem backup .Sh SYNOPSIS .Nm dump -.Op Fl 0123456789ackMnSu +.Op Fl 0123456789ackMnqSu .Op Fl B Ar records .Op Fl b Ar blocksize .Op Fl d Ar density @@ -253,6 +253,11 @@ notify all operators in the group .Dq operator by means similar to a .Xr wall 1 . +.It Fl q +Make +.Nm +abort immediately whenever operator attention is required, +without prompting in case of write errors, tape changes etc. .It Fl Q Ar file Enable the Quick File Access support. Tape positions for each inode are stored into the file diff --git a/dump/dump.h b/dump/dump.h index 4836ba8..0e276b5 100644 --- a/dump/dump.h +++ b/dump/dump.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - AlcĂ´ve , 2000 * - * $Id: dump.h,v 1.30 2001/08/13 16:17:52 stelian Exp $ + * $Id: dump.h,v 1.31 2001/08/16 09:37:59 stelian Exp $ */ /*- @@ -75,6 +75,7 @@ extern char lastlevel; /* dump level of previous dump */ extern char level; /* dump level of this dump */ extern int uflag; /* update flag */ extern int Mflag; /* multi-volume flag */ +extern int qflag; /* quit on errors flag */ extern char *eot_script; /* end of volume script fiag */ extern int diskfd; /* disk file descriptor */ extern int tapefd; /* tape file descriptor */ diff --git a/dump/main.c b/dump/main.c index 7a5884b..8fcf468 100644 --- a/dump/main.c +++ b/dump/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.56 2001/08/13 16:17:52 stelian Exp $"; + "$Id: main.c,v 1.57 2001/08/16 09:37:59 stelian Exp $"; #endif /* not lint */ #include @@ -104,6 +104,7 @@ char lastlevel; /* dump level of previous dump */ char level; /* dump level of this dump */ int uflag; /* update flag */ int Mflag; /* multi-volume flag */ +int qflag; /* quit on errors flag */ char *eot_script; /* end of volume script fiag */ int diskfd; /* disk file descriptor */ int tapefd; /* tape file descriptor */ @@ -235,7 +236,7 @@ main(int argc, char *argv[]) #ifdef KERBEROS "k" #endif - "Mn" + "Mnq" #ifdef USE_QFA "Q:" #endif @@ -345,6 +346,10 @@ main(int argc, char *argv[]) notify = 1; break; + case 'q': + qflag = 1; + break; + #ifdef USE_QFA case 'Q': /* create tapeposfile */ gTapeposfile = optarg; @@ -949,7 +954,7 @@ usage(void) #ifdef KERBEROS "k" #endif - "MnSu" + "MnqSu" "] [-B records] [-b blocksize] [-d density]\n" "\t%s [-e inode#,inode#,...] [-E file] [-f file] [-h level] " #ifdef USE_QFA diff --git a/dump/optr.c b/dump/optr.c index d1cdf1d..cd98e66 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: optr.c,v 1.25 2001/07/18 09:12:05 stelian Exp $"; + "$Id: optr.c,v 1.26 2001/08/16 09:37:59 stelian Exp $"; #endif /* not lint */ #include @@ -106,6 +106,12 @@ query(const char *question) FILE *mytty; time_t firstprompt, when_answered; + if (qflag) { + msg("%s - forced abort\n", question); + dumpabort(0); + /* NOTREACHED */ + } + firstprompt = time(NULL); if ((mytty = fopen(_PATH_TTY, "r")) == NULL)