$ BATCH = "''F$MODE()'" .EQS. "BATCH" $ VER = 'F$VERIFY(0)' .AND. .NOT. BATCH $! $! COPYTREES.COM $! $! Author: J. L. BINGHAM $! ManTech International $! 2320 Mill Road $! Alexandria, VA 22314 $! (703) 838-5600 $! $! This command procedure is designed to make the copying of directory $! trees containing VAX Systems SIG Symposia tapes easy and consistent. $! A small file suitable for a label is produced and printed. $! $! The command procedure assumes that the [VAX000] and [VAX000.INDEX] $! directories exist and copies them to every tape made. It also assumes $! that the symposia tapes are hanging from directories named [VAX79A], $! [VAX79B], ... $! $! When the procedure is being run on my system (ST_BIN translates to $! MILLRD::) it puts my name and phone number in MSG and prints the label $! on a printer set to forms=5. On another system it will leave the print $! command alone and will use the MSG defined after the label NOTJOE:. This $! provides a place for you to put your name and telephone number. (You may $! want to change the logic instead so you can pass the command procedure $! intact without having the next person print labels saying you made the $! tape.) $! $! Required information may be passed as parameters or entered in $! response to prompts. Parameters are defined as follows: $! $! P1 -- Tape drive name, e.g. MTA1: $! P2 -- Name of the first directory tree to be copied, not including [VAX000]. $! e.g. VAX79B. (Note: "VAX7" would start at VAX79A) $! P3 -- Name of the last directory tree to be copied, $! (may also be truncated, "VAX" will include the $! last directory starting VAX) $! P4 -- T, Y or 1 will cause a listing of the tape to be $! generated. $! P5 -- A name to be used for that file. (A place to put the $! name of the intended recipient of the tape if desired.) $! P6 -- T, Y or 1 will cause the above listing to be printed. $! $! The following command will copy VAX000 and the fall 1979 through $! the fall 1980 tapes with a backup listing being generated but not printed. $! The listing will be [VAX000.TEMP]NEXTNODE.LIS. $! SUBMIT COPYTREES/PAR=(MTA0:,VAX79B,VAX80B,Y,NEXTNODE,N) $! $ SET PROCESS/PRIOITY=3 $ SET DEFAULT [VAX000] $ UNLOADSW := $ IF "''F$LOGICAL("ST_NODE")'" .NES. "MILLRD::" THEN $GOTO NOTJOE $ PRINT := PRINT/FORM=5 $ MSG := JOE BINGHAM (703)838-5600 $ GOTO START $ NOTJOE: $ MSG := USER'S NAME AND PHONE NUMBER $ if "''f$mode()'" .eqs. "INTERACTIVE" then - inquire msg "Enter your name and phone number for label" $ GOTO START $! $RESTART: $ WRITE SYS$OUTPUT "Error allocating ''P1'" $ P1 := $START: $ IF "''P1'" .EQS. "" THEN $INQUIRE P1 "Enter the tape drive name, e.g. MTA1" $ P1 := 'F$EXTRACT(0,4,P1)' $ IF .NOT. BATCH THEN $ON WARNING THEN $GOTO RESTART $ ALLOCATE 'P1' TAPE $ IF "''P2'" .EQS. "" THEN $INQUIRE P2 "Enter the name of the first tree to be copied, not counting [VAX000]" $ IF "''P3'" .EQS. "" THEN $INQUIRE P3 "Enter the name of the last tree to be copied" $ ON WARNING THEN $GOTO ERROR $ ON CONTROL_Y THEN $GOTO ERROR $ IF BATCH THEN $REQUEST/REPLY "Please mount a tape on ''P1' with write ring installed." $ IF .NOT. BATCH THEN $INQUIRE OK "Mount a tape on ''P1' and enter " $ OPEN/WRITE LABEL [.TEMP]'P1'.LBL $ WRITE LABEL " VAX Systems SIG Tape Copy Project" $ WRITE LABEL "" $ WRITE LABEL "Tape is in VAX DCL BACKUP format with 1600 bpi density." $ WRITE LABEL "See [VAX000]0README.1ST. ''MSG'" $ WRITE LABEL "" $ WRITE LABEL "This tape contains:" $ WRITE LABEL " root directory save-set name" $ DIRECTORY/OUT=[.TEMP]'P1'.TMP/NOHEAD/NOTRAIL [000000]VAX*.DIR $ OPEN/READ DIR [.TEMP]'P1'.TMP $ SET VERIFY $ MOUNT/FOREIGN/DENSITY=1600 TAPE $! $ SHOW TIME $ BACKUP [VAX000],[VAX000.INDEX] TAPE:VAX000.MAJ $ DUMMY = 'F$VERIFY(VER) $ WRITE LABEL " [VAX000] VAX000.MAJ" $! $LOOP: $ READ/END_OF_FILE=EXIT DIR LINE $ LEFT = 'F$LOCATE("]",LINE)' + 1 $ LEN = 'F$LOCATE(".DIR;1",LINE)' - LEFT $ FOUND := 'F$EXTRACT(LEFT,LEN,LINE)' $ IF "''FOUND'" .LTS. "''P2'" THEN $GOTO LOOP $ IF "''FOUND'" .GTS. "''P3'" THEN $GOTO EXIT $! $ SHOW TIME $ SET VERIFY $ BACKUP/NOREWIND ['FOUND'...] TAPE:'FOUND'.ALL $ DUMMY = 'F$VERIFY(VER) $ WRITE LABEL " [''FOUND'] ''FOUND'.ALL" $ GOTO LOOP $! $ERROR: $ UNLOADSW := /NOUNLOAD $ IF BATCH THEN $REQUEST "******ERROR MAKING DECUS TAPE******" $ IF .NOT. BATCH THEN $WRITE SYS$OUTPUT "******COPY INCOMPLETE******" $ CLOSE LABEL $ GOTO EXIT2 $! $EXIT: $ TIME := 'F$TIME()' $ DUMMY = 'F$VERIFY(0) $ WRITE LABEL "''F$EXTRACT(0,11,TIME)' ''F$EXTRACT(11,12,TIME)'" $ CLOSE LABEL $ WRITE SYS$OUTPUT "BE SURE TO PASS THE FOLLOWING INFORMATION TO THE USER OF THIS TAPE" $ TYPE [.TEMP]'P1'.LBL $ WRITE SYS$OUTPUT "LABEL INFORMATION WILL ALSO BE PRINTED" $ PRINT [.TEMP]'P1'.LBL $ IF .NOT. BATCH .AND. "''P4'" .EQS. "" THEN $INQUIRE/NOPUNC P4 "Create a listing of the save-sets? " $ IF .NOT. P4 THEN $GOTO EXIT2 $ IF .NOT. BATCH .AND. "''P5'" .EQS. "" THEN $INQUIRE P5 - "Enter a name for the listing. Default is ''P1'.LIS" $ IF "''p5'" .eqs. "" then p5 = p1 + ".LIS" $ OPEN/READ LABEL [.TEMP]'P1'.LBL $ READ LABEL LINE $ READ LABEL LINE $ READ LABEL LINE $ READ LABEL LINE $ READ LABEL LINE $ READ LABEL LINE $ READ LABEL LINE $READLOOP: $ READ/END_OF_FILE=NOMORESETS LABEL LINE $ START = 'F$LOCATE(" VAX",LINE)' + 1 $ IF START .EQ. 'F$LENGTH(LINE)'+1 THEN $GOTO NOMORESETS $ BACKUP/LIST=[.TEMP]'P1'T TAPE:'F$EXTRACT(START,13,LINE)' $ APPEND/NEW [.TEMP]'P1'T.LIS [.TEMP]'P5'.LIS $ GOTO READLOOP $NOMORESETS: $ CLOSE LABEL $ DELETE [.TEMP]'P1'.LBL.* $ IF .NOT. BATCH .AND. "''P6'" .EQS. "" THEN $INQUIRE/NOPUNC P6 "Print the save-set listing? " $ IF P6 THEN $PRINT [.TEMP]'P5' $ DELETE [.TEMP]'P1'T.LIS.* $! $EXIT2: $ ON ERROR THEN $CONTINUE $ ON CONTROL_Y THEN $CONTINUE $ DISMOUNT'UNLOADSW' 'P1' $ DEALLOCATE 'P1' $ CLOSE DIR $ DELETE [.TEMP]'P1'.TMP.* $ IF BATCH THEN $ASSIGN NL: SYS$PRINT $ VER = 'F$VERIFY(VER) $! $! End of COPYTREES.COM $!