For -l: specify the timeout on the command line (in seconds) instead of

hardwiring it to 2s, as suggested on tech-userlevel.
This commit is contained in:
bouyer 2002-01-07 17:34:08 +00:00
parent 944794a509
commit cf39881866
3 changed files with 17 additions and 14 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: dump.8,v 1.44 2001/12/30 04:03:16 lukem Exp $
.\" $NetBSD: dump.8,v 1.45 2002/01/07 17:34:08 bouyer Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" Regents of the University of California.
@ -43,7 +43,7 @@
.Nd file system backup
.Sh SYNOPSIS
.Nm ""
.Op Fl 0123456789aceFlnStu
.Op Fl 0123456789aceFnStu
.Bk -words
.Op Fl B Ar records
.Ek
@ -66,6 +66,9 @@
.Op Fl L Ar label
.Ek
.Bk -words
.Op Fl l Ar timeout
.Ek
.Bk -words
.Op Fl r Ar cachesize
.Ek
.Bk -words
@ -220,11 +223,11 @@ but full backups retain them.
.It Fl k Ar read blocksize
The size in kilobyte of the read buffers, rounded up to a multiple of the
file system block size. Default is 32k.
.It Fl l
.It Fl l Ar timeout
If a tape change is required, eject the tape and wait for the drive to
be ready again. This is to be used with tape changers which automatically load
the next tape when the tape is ejected. If after 2 minutes the drive is not
ready
the next tape when the tape is ejected. If after the timeout (in seconds) the
drive is not ready
.Nm
falls back to the default behavior, and prompts the operator for the next
tape.

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.49 2001/12/30 04:03:17 lukem Exp $ */
/* $NetBSD: main.c,v 1.50 2002/01/07 17:34:09 bouyer Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95";
#else
__RCSID("$NetBSD: main.c,v 1.49 2001/12/30 04:03:17 lukem Exp $");
__RCSID("$NetBSD: main.c,v 1.50 2002/01/07 17:34:09 bouyer Exp $");
#endif
#endif /* not lint */
@ -140,7 +140,7 @@ main(int argc, char *argv[])
obsolete(&argc, &argv);
while ((ch = getopt(argc, argv,
"0123456789aB:b:cd:eFf:h:k:lL:nr:s:StT:uWw")) != -1)
"0123456789aB:b:cd:eFf:h:k:l:L:nr:s:StT:uWw")) != -1)
switch (ch) {
/* dump level */
case '0': case '1': case '2': case '3': case '4':
@ -193,7 +193,7 @@ main(int argc, char *argv[])
case 'l': /* autoload after eject full tapes */
eflag = 1;
lflag = 1;
lflag = numarg("timeout (in seconds)", 1, 0);
break;
case 'L':
@ -609,9 +609,9 @@ usage(void)
const char *prog = getprogname();
(void)fprintf(stderr,
"usage: %s [-0123456789aceFlnStu] [-B records] [-b blocksize]\n"
"usage: %s [-0123456789aceFnStu] [-B records] [-b blocksize]\n"
" [-d density] [-f file] [-h level] [-k read-blocksize]\n"
" [-L label] [-r read-cache] [-s feet] [-T date] files-to-dump\n"
" [-L label] [-l timeout] [-r read-cache] [-s feet] [-T date] files-to-dump\n"
" %s [-W | -w]\n", prog, prog);
exit(X_STARTUP);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tape.c,v 1.36 2001/12/30 04:03:17 lukem Exp $ */
/* $NetBSD: tape.c,v 1.37 2002/01/07 17:34:09 bouyer Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tape.c 8.4 (Berkeley) 5/1/95";
#else
__RCSID("$NetBSD: tape.c,v 1.36 2001/12/30 04:03:17 lukem Exp $");
__RCSID("$NetBSD: tape.c,v 1.37 2002/01/07 17:34:09 bouyer Exp $");
#endif
#endif /* not lint */
@ -438,7 +438,7 @@ close_rewind(void)
broadcast("CHANGE DUMP VOLUMES!\a\a\n");
}
if (lflag) {
for (i = 0; i < 12; i++) { /* wait 2 mn */
for (i = 0; i < lflag / 10; i++) { /* wait lflag seconds */
if (host) {
if (rmtopen(tape, 0, 0) >= 0) {
rmtclose();