---------- X-Sun-Data-Type: text X-Sun-Data-Description: text X-Sun-Data-Name: text X-Sun-Content-Lines: 93 First, Thanks to all of you who sent answers. Brett Lymn blymn@awadi.com.AU Lenny Turetsky lturetsk@econ.yale.edu Kevin Sheehan kevin@uniq.com.au Marcel A. Bernards bernards@ECN.NL Jean-Christophe Touvet jct@edelweb.fr Peter Allan pallan@clare.risley.aeat.co.uk B C Hamshere B.C.Hamshere@newcastle.ac.uk C.R. Ritson C.R.Ritson@newcastle.ac.uk Perry Hutchison perryh@pluto.rain.com Rick Pluta pluta@cgc1.mcae.mke.ab.com My original question was (fully attached): >> I am using dump to backup a network of SUN work stations running SunOS 4.1.x. >> Soon we are going to get our new Auto Loader Tape system. >> >> I am wondering if there is a way to know what will be the size (in MB) >> of a dump file? >> If I can get this information I can decide, in my dump script, >> to put the tape off-line and getting the next tape in. Answers are summarized bellow: 1) Dump to /dev/null and read the log file. 2) Dump to /dev/null and pipe the dump to a program that can parse the log and exit after getting the size info. I choose this option. 3) Use part of code from a package called Amanda. Amanda official distribution is at 4) Specify the dumpfile as a file within a non-existent directory. This causes the dump to fail, *after* reporting the estimated dump size, when it can't open the output file. Here is a code I wrote, in Perl, that solve this specific issue. #! /usr/local/bin/perl # Get Args. # # Accept to get format like the folowing. # if ( $#ARGV != 1 ) { print "Usage: $0 dumpLevel fileSystem\n" ; exit (-1) ; } $dumpLevel = $ARGV[0] ; $fileSystem = $ARGV[1] ; # # Create a pipe to the dump command, make sure to re-direct STDERR # of the dump command in order to get all its output. # open(DUMP_SIZE, "/usr/ucb/rsh black dump ${dumpLevel}f /dev/null /dev/r${fileSystem} 2>&1|" ) ; $foundFlage = 1 ; while( ($_ = ) && ($foundFlage) ) { chop ; # # parse line of the forms: # # DUMP: estimated 27340 blocks (13.35MB) on 0.38 tape(s). # DUMP: estimated 1164 blocks (582KB) on 0.02 tape(s). # if (/DUMP: estimated.*\(([\w\.]+)\).*\(\w+\)/ ) { #print "Found size\n" ; $dumpSize = $1 ; print "dumpSize is $dumpSize\n" ; $foundFlage = 0 ; } } Thanks again, Bamby. ========================================================== Yehuda Bamnolker. Email: bamby@scorpio.com Scorpio Communications Ltd. Phone: 972-3-5339654 Software Developer Fax: 972-3-5339518 __o System Administrator ,-\< ==========================================================...()~/() ---------- X-Sun-Data-Type: sun-deskset-message X-Sun-Data-Name: orig-question X-Sun-Encoding-Info: uuencode X-Sun-Content-Lines: 42 begin 600 orig-question M1G)O;2!B86UB>2!4=64@36%R(#(X(#$R.C,Y.C Q(#$Y.34*4F5T=7)N+5!A M=&@Z(#QB86UB>3X*4F5C96EV960Z(&)Y(%-C;W)P:6\N0V]M("@T+C$O4T-/ M4E!)3RU"86UB>2D*"6ED($%!,#@Y,#D[(%1U92P@,C@@36%R(#DU(#$R.C,X M.C4Y*S R, I$871E.B!4=64L(#(X($UAF4@ M*&EN($U"*0IO9B!A(&1U;7 @9FEL93\*268@22!C86X@9V5T('1H:7,@:6YF M;W)M871I;VX@22!C86X@9&5C:61E+"!I;B!M>2!D=6UP('-C5]D=6UP*2!T:&%T"F-A;B!S M=7!P;W)T('1H:7,@<')O8FQE;2!O%1A<&53:7IE(#T@ M7-T96T@ M*"!F:6QE+7-Y971MPH@(" @=&AI71E71E7-T96TI"@EN=6U-0GET97,@ M*ST@=&AI