-$Id: CHANGES,v 1.119 2001/07/18 08:50:58 stelian Exp $
+$Id: CHANGES,v 1.120 2001/07/18 09:50:48 stelian Exp $
Changes between versions 0.4b22 and 0.4b23 (released ????????????)
==================================================================
5. Fixed the looping problem in dump introduced in the
previous version.
+6. Changed the -B option of dump to limit the size of
+ _compressed_ output per volume if compression is on.
+ Patch contributed by Helmut Jarausch
+ <jarausch@igpm.rwth-aachen.de>.
+
Changes between versions 0.4b21 and 0.4b22 (released May 12, 2001)
==================================================================
-$Id: THANKS,v 1.45 2001/05/26 11:11:16 stelian Exp $
+$Id: THANKS,v 1.46 2001/07/18 09:50:48 stelian Exp $
Dump and restore were written by the people of the CSRG at the University
of California, Berkeley.
Andreas Hasenack andreas@conectiva.com.br
Christian Haul haul@informatik.tu-darmstadt.de
Jean-Paul van der Jagt jeanpaul@dutepp0.et.tudelft.nl
+Helmut Jarausch jarausch@igpm.rwth-aachen.de
Eric Jergensen eric@dvns.com
Jeff Johnson jbj@redhat.com
Charles Karney karney@users.sourceforge.net
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dump.8.in,v 1.26 2001/04/10 13:42:22 stelian Exp $
+.\" $Id: dump.8.in,v 1.27 2001/07/18 09:50:48 stelian Exp $
.\"
.Dd __DATE__
.Dt DUMP 8
.It Fl B Ar records
The number of 1 kB blocks per volume.
This option overrides the end-of-media detection, and calculation
-of tape size based on length and density.
+of tape size based on length and density. If compression is on this
+limits the size of the compressed output per volume.
.It Fl a
.Dq auto-size .
Bypass all tape length calculations, and write
reels already written just hang around until the entire tape
is written.
.Pp
+The estimated number of tapes is not correct if compression is on.
+.Pp
It would be nice if
.Nm
knew about the dump sequence,
* Stelian Pop <pop@noos.fr>, 1999-2000
* Stelian Pop <pop@noos.fr> - AlcĂ´ve <www.alcove.fr>, 2000
*
- * $Id: dump.h,v 1.24 2001/04/10 13:42:22 stelian Exp $
+ * $Id: dump.h,v 1.25 2001/07/18 09:50:48 stelian Exp $
*/
/*-
int diskfd; /* disk file descriptor */
int tapefd; /* tape file descriptor */
int pipeout; /* true => output to standard output */
+int fifoout; /* true => output to fifo */
dump_ino_t curino; /* current inumber; used globally */
int newtape; /* new tape flag */
int density; /* density in 0.1" units */
long tapesize; /* estimated tape size, blocks */
long tsize; /* tape size in 0.1" units */
long asize; /* number of 0.1" units written on current tape */
+unsigned long csize; /* number of compressed bytes written on current tape */
int etapes; /* estimated number of tapes */
int nonodump; /* if set, do not honor UF_NODUMP user flags */
int unlimited; /* if set, write to end of medium */
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.50 2001/07/18 09:12:05 stelian Exp $";
+ "$Id: main.c,v 1.51 2001/07/18 09:50:48 stelian Exp $";
#endif /* not lint */
#include <config.h>
tapeprefix = "standard output";
}
- if (blocksperfile)
+ if (blocksperfile && !compressed)
blocksperfile = blocksperfile / ntrec * ntrec; /* round down */
else if (!unlimited) {
/*
strncpy(tape, tapeprefix, MAXPATHLEN);
tape[MAXPATHLEN - 1] = '\0';
+ if (!pipeout) {
+ if (STAT(tape, &statbuf) != -1)
+ fifoout= statbuf.st_mode & S_IFIFO;
+ }
+
if (!sizest) {
msg("Date of this level %c dump: %s", level,
tnow = trewind();
- if (pipeout)
+ if (pipeout || fifoout)
msg("%ld tape blocks (%.2fMB)\n", spcl.c_tapea,
((double)spcl.c_tapea * TP_BSIZE / 1048576));
else
case SIGHUP:
case SIGTERM:
case SIGTRAP:
- if (pipeout)
+ if (pipeout || fifoout)
quit("Signal on pipe: cannot recover\n");
msg("Rewriting attempted as response to unknown signal: %d.\n", signo);
(void)fflush(stderr);
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.48 2001/07/18 09:12:05 stelian Exp $";
+ "$Id: tape.c,v 1.49 2001/07/18 09:50:48 stelian Exp $";
#endif /* not lint */
#include <config.h>
nextblock = slp->tblock;
trecno = 0;
asize += tenths + returned.clen / density;
+ csize += returned.clen;
blockswritten += ntrec;
blocksthisvol += ntrec;
- if (!pipeout && !unlimited && (blocksperfile ?
- (blocksthisvol >= blocksperfile) : (asize > tsize))) {
- close_rewind();
- startnewtape(0);
+ if (!pipeout && !unlimited) {
+ if (blocksperfile) {
+ if ( compressed ? csize >= blocksperfile * 1024
+ : blocksthisvol >= blocksperfile ) {
+ close_rewind();
+ startnewtape(0);
+ }
+ }
+ else if (asize > tsize) {
+ close_rewind();
+ startnewtape(0);
+ }
}
timeest();
}
#endif
{
(void) close(tapefd);
- while ((f = OPEN(tape, 0)) < 0)
- sleep (10);
- (void) close(f);
+ if (!fifoout) {
+ while ((f = OPEN(tape, 0)) < 0)
+ sleep (10);
+ (void) close(f);
+ }
}
eot_code = 1;
if (eot_script && spcl.c_type != TS_END) {
slp->count = lastspclrec + blks + 1 - spcl.c_tapea;
slp->inode = curino;
asize += tenths + returned.clen / density;
+ csize += returned.clen;
blockswritten += ntrec;
blocksthisvol += ntrec;
#endif
enslave(); /* Share open tape file descriptor with slaves */
asize = 0;
+ csize = 0;
blocksthisvol = 0;
if (top)
newtape++; /* new tape signal */