.; .; .; B R U . C M D .; .; Conduct a standard BRU run. .; This command file can be invoked either interactively by .; >@BRU .; Or as an MCR command by .; >@BRU input output .; or .; >@BRU output=input .; Input and output devices will be mounted (foreign) as necessary. .; An output disk mounted foreign WILL be initialized. .; .; The following switches are legal, and can appear on either input .; or output device: .; Switch Default Meaning .; /BA /-BA Run bad before copy (foreign disks only). .; /BK:set /BK Backup set name. .; /DE:dns varies Tape density. .; /EX /-EX Exclude the named files from the copy. .; /IM /-IM Disk is "image mode". .; /IN Initial index file size. .; /MX Maximum index file size. .; /PR /PR Preserve file IDs. .; /RW /RW Rewind tape before copy. No effect for disk. .; /UF /UF Create UFDs as needed. .; /VE /-VE Verify volume after copy. .; .; To add another switch, make the necessary modifications at all .; points identified by the string ".;//". .; .ENABLE SUBSTITUTION .ENABLE ESCAPE .SETS S$PROC .SETS S$SPAC " " .; .; At this point, the user is invited to insert here a set of .; identification strings for the systems he may wish to run .; this command file on. The strings are defined by .; .SETS sysnam "system identification" .; where is the DECnet node name, or the system name .; assigned at SYSGEN. The appropriate identification string .; will be selected at run time based on the contents of . .; .; If the system you are executing on supports extended logical .; names, logical name SYSTEM_IDENTIFICATION will be translated, .; (if it exists) and the translation will be used instead of the .; system identification generated as above. .; .SETS FENNY "PDP-11/84" .SETS MARVIN "PDP-11/03" .SETS ZAPHOD "PDP-11/74" .; .; Now, translate the above table (or logical name .; SYSTEM_IDENTIFICATION if it exists) into a string to display .; if we need it. .; .SETS S$SNAM "" .IFDF .TRANSLATE SYSTEM_IDENTIFICATION .IFDF .SETS S$SNAM .IF S$SNAM = "" .IFDF '' .SETS S$SNAM '' .IF S$SNAM <> "" .SETS S$SNAM " - "+S$SNAM .SETS S$SNAM +"::"+S$SNAM .TEST S$PROC .SETS S$PROT S$SPAC[1:36.-(/2)]+S$PROC .TEST S$SNAM .SETS S$SNAT S$SPAC[1:36.-(/2)]+S$SNAM .; .; Determine if we are interactive. .; .SETF L$INTR .IF P1 = "" .IF P2 = "" .SETT L$INTR .; .; Display the title lines. .; .;.;.; .IFF L$INTR .GOTO NOTITL ; ;'S$PROT' ; ; Perform a backup on system ;'S$SNAT' ; .NOTITL:.; .; .; If the command line is in MCR format, convert to DCL. .; .IF P2 = "" .PARSE P1 "=" P2 P1 .; .; Create all switches and their defaults. .; .SETF V$BA ! Do not run BAD first. .SETS V$BK "" ! Backup set name (null = next one). .SETN V$DE 0. ! Tape density. .SETF V$EX ! Do not exclude the named files. .SETF V$IM ! Disk is not image mode. .SETN V$IN 0. ! Default initial index size. .SETN V$MX 0. ! Default maximum index size. .SETT V$PR ! Preserve file IDs. .SETT V$RW ! Rewind tape before copy. .SETT V$UF ! Create UFDs as needed. .SETF V$VE ! Do not verify volume after copy. .;// .;// To add another switch, define its corresponding symbol .;// here. This will cause the switch parser in subroutine DEV .;// to recognise and parse it. .;// .; .; Create the table of legal tape densities. The first density .; given will be the default for output. Make entries in this .; table ONLY for tapes that support more than one density, as .; an entry here enables the /DEN switch in the BRU command line .; (harmless), and the interactive query for density, even though .; there is only one legal entry (annoying). The first entry in .; the list for each device will be the default density for output. .; .SETS DNS$MM "1600,800" ! Legal density for MM: .;.; .SETS DNS$MT "800" ! Density for MT: intentionally omitted. .SETS DNS$MS "1600,800" ! Legal density for MS: .SETS DNS$MF "1600,6250" ! Legal density for MF: .; .; Set up the MCR command prefix, so we will work under DCL. .; .SETS S$MCR "" .IF <> "MCR" .SETS S$MCR "MCR " .; .; Create U.CW1 mask words to recognize devices of interest. .; .SETN O$DUCW 140010 ! UCW1 value for a disk. .SETN O$DDNC 001700 ! UCW1 "dont care" mask for a disk. .SETN O$TUCW 000140 ! UCW1 value for a tape. .SETN O$TDNC 140621 ! UCW1 "dont care" mask for a tape. .; .; Define various properties of the index file. .; .SETN N$LIMI 65500. ! Absolute maximum filess on a volume. .SETN N$1HDR 25600.-7. ! Number of files with 1 header index. .SETN N$2HDR 51712.-13. ! Number of files with 2 header index. .; .; Define the opposite of "IN" (which is "OU"), and .; the opposite of "OU" (which is "IN"). .; .SETS IN$OPP "OU" .SETS OU$OPP "IN" .; .; Make assumptions about the "other" device suitable for the .; first pass through "DEV". .; .SETT OU$DSK ! Assume (for the moment) output to disk .SETF OU$IMG ! Assume (for the moment) not image mode .SETT IN$FOK ! Filespecs OK on input volume. .SETF OU$FOK ! Filespecs not OK on output volume. .; .; Ask for the input device. Any switches which appear .; on the line will be parsed, also. .; .GOSUB DEV 'P1'|IN|Enter input device .; .; Reset any switches that are position dependant. .;// If you add a switch that distinguishes between input and .;// output devices, you may need to reset or otherwise process .;// it here. .; .SETF V$IM ! Disk is not image mode. .; .; Ask for the output device. Any switches which appear .; on the line will be parsed, also. .; .GOSUB DEV 'P2'|OU|Enter output device .; .; Force switch settings consistent with the device types specified. .;// If you add a switch that only applies to certain device types, .;// you may want to reset it here for devices it does not apply to. .;// alternatively, you may wish to have the DEV subroutine reject it. .; .IFT OU$F11 .SETF V$BA ! If output is F-11, ignore /BA. .IFF OU$DSK .SETF V$BA ! If output tape, ignore /BA. .IFT OU$F11 .SETT V$PR ! If output is F-11, ignore /-PR. .IFT OU$SER .SETT V$PR ! If output image or tape, no /-PR. .IFT OU$DSK .IFT IN$DSK .SETF V$RW ! Can not rewind a disk. .IFF OU$F11 .SETF V$UF ! If output not F-11, ignore /UF. .IFT OU$SER .SETF V$UF ! If output image or tape, no /UF. .IF IN$FIL = "" .SETF V$EX ! If no input files, ignore /EX. .IFT OU$F11 .SETN V$IN 0. ! If output is F-11, ignore /IN. .IFT OU$SER .SETN V$IN 0. ! If output image or tape, no /IN. .IFT OU$F11 .SETN V$MX 0. ! If output is F-11, ignore /MX. .IFT OU$SER .SETN V$MX 0. ! If output image or tape, no /MX. .IFF IN$DSK .SETF OU$IMG ! If input is tape, output not img. .IFF OU$DSK .SETF IN$IMG ! If output is tape, input not img. .SETL L$IMGP IN$DSK&OU$DSK ! Image possible only disk-to-disk. .; .; Set the tape density based on what we know so far: .; If the output device supports it, .; replace 0 with proper default .; If neither device supports it, .; force it to zero. .; .SETS S$DRVR OU$DEV[1:2] .SETS S$DENS "0" .IFDF DNS$'S$DRVR' .PARSE DNS$'S$DRVR' "," S$DENS S$JUNK .IFDF DNS$'S$DRVR' .IF V$DE = 0 .SETN V$DE 'S$DENS'. .IFNDF DNS$'S$DRVR' .SETS S$DRVR IN$DEV[1:2] .IFNDF DNS$'S$DRVR' .SETN V$DE 0. ! Ignore /DE if not supported. .; .; Supply dummy initial index file limit values. .; .SETS S$IXLM "" ! Must be defined. Value set later. .SETS S$IXMX "" ! Must be defined. Value set later. .SETN O$IXLM 0 ! Index limit not computed yet. .; .; If this is not an interactive run, we have all the information we .; need. Go execute the necessary commands. .; .IFF L$INTR .GOTO DOIT .; .; If we are interactive, tell the user what we're about to do. .;// If you add a switch, add an appropriate message for it here. .; ; ; By default, the BRU run will be done as follows: ; .; .; Running BAD is a possibility only if the output is to .; a disk that is not mounted FILES-11. .; .IFT OU$DSK .IFF OU$F11 .IFF V$BA ; BAD will not be run on the output disk. .IFT OU$DSK .IFF OU$F11 .IFT V$BA ; BAD will be run on the output disk. .; .; BRU image input is only a possibility if both input and .; output devices are disk. .; .IFT L$IMGP .IFF IN$IMG ; The input disk is in FILES-11 (not BRU backup set) format. .IFT L$IMGP .IFT IN$IMG ; The input disk is in BRU backup set format. .; .; BRU image output is only a possibility if both input and .; output devices are disk. .; .IFT L$IMGP .IFF OU$IMG ; The output disk is in FILES-11 (not BRU backup set) format. .IFT L$IMGP .IFT OU$IMG ; The output disk is in BRU backup set format. .; .; A backup set name is legal only if either the input or the .; output device is serial (meaning either tape or BRU image). .; .SETL L$Q IN$SER!OU$SER .IFT L$Q .IF V$BK = "" ; A backup set name was not specified. .IFT L$Q .IF V$BK <> "" ; Backup set "'V$BK'" will be restored. .; .; Specifying exclusion of the named input files only makes .; sense if input files were specified. .; .IF IN$FIL <> "" .IFF V$EX ; Only the named files will be copied. .IF IN$FIL <> "" .IFT V$EX ; All except the named files will be copied. .; .; Preservation of file IDs is a possibility only if output .; is not to serial media (tape or BRU image) and not to .; a disk mounted FILES-11. .; .IFF OU$SER .IFF OU$F11 .IFF V$PR ; File IDs will not be preserved. .IFF OU$SER .IFF OU$F11 .IFT V$PR ; File IDs will be preserved. .; .; Specifying the maximum number of file IDs is only possible .; if output is not to serial media (tape or BRU image) and .; not to a disk mounted FILES-11, and file IDs are not being .; preserved. .; .IFF OU$SER .IFF OU$F11 .IFF V$PR .GOSUB MAX V$MX O$IXLM 'OU$DEV' .IFF OU$SER .IFF OU$F11 .IFF V$PR ; The volume will hold a maximum of 'V$MX%D'. files. .; .; Specifying the initial number of file IDs is only possible .; if output is not to serial media (tape or BRU image) and .; not to a disk mounted FILES-11, and file IDs are not being .; preserved. If no value was specified, a default must be .; supplied. The value must be clamped to the allowed limits .; in any case. .; .SETN N$INVL V$IN .IFF OU$SER .IFF OU$F11 .IFF V$PR .IF V$IN = 0 .GOSUB INI V$IN 'V$MX%D'. .IF V$IN > V$MX .SETN V$IN V$MX .IF V$IN < 16. .SETN V$IN 16. .IFF OU$SER .IFF OU$F11 .IFF V$PR ; Initially, the index file will hold 'V$IN%D'. files. .; .; Rewinding the tape is only a possibility if either .; input or output is not to disk. .; .SETL L$Q IN$DSK&OU$DSK .IFF L$Q .IFF V$RW ; The tape will not be rewound first. .IFF L$Q .IFT V$RW ; The tape will be rewound first. .; .; Specifying the media density is optional of the input medium .; is tape, required if output medium is tape, impossible .; otherwise. .; .SETS S$DRVR IN$DEV[1:2] .IFNDF DNS$'S$DRVR' .SETS S$DRVR OU$DEV[1:2] .IFDF DNS$'S$DRVR' .IF V$DE <> 0 ; The tape density is 'V$DE%D' BPI. .IFDF DNS$'S$DRVR' .IF V$DE = 0 ; The tape density is defaulted. .; .; Creating new directories is only possible on a mounted .; output disk that is not being used to create a BRU image. .; .IFF OU$SER .IFT OU$F11 .IFF V$UF ; BRU will not create directories on the output disk. .IFF OU$SER .IFT OU$F11 .IFT V$UF ; BRU will create directories on the output disk. .; .; The output volume can ALWAYS be verified. .; .IFF V$VE ; The output volume will not be verified. .IFT V$VE ; The output volume will be verified. .; .; Now, give the user a chance to change the defaults. If he passes .; it up, go execute the required commands. .; ; .SETF L$OP .INQIOP:.SETL L$Q L$OP .ASK [L$OP] L$OP Do you wish to change these defaults .IFT .GOTO HELPOP .IFF L$OP .GOTO DOIT .; .; The user has decided he does not want to take our thoughtful .; recommendations on how to do the BRU run. The payment for his .; arrogance is to answer each of the questions that follow. .;// If you add a switch, it might be polite to query the user about .;// it here if he elects to run this command file interactively. .; ; .DISABLE LOWERCASE .; .; Running BAD is a possibility only if the output is to .; a disk that is not mounted FILES-11. .; .INQIBA:.SETL L$Q V$BA .IFT OU$DSK .IFF OU$F11 .ASK [V$BA] V$BA Shall I run BAD on the output disk .IFT .GOTO HELPBA .; .; BRU image input is only a possibility if both input and .; output devices are disk. .; .INQIII:.SETL L$Q IN$IMG .IFT L$IMGP .ASK [IN$IMG] IN$IMG Is the input disk in BRU image format .IFT .GOTO HELPII .; .; BRU image output is only a possibility if both input and .; output devices are disk, and the input is not in image .; mode. .; .INQIIO:.SETL L$Q OU$IMG .IFT IN$IMG .SETF OU$IMG .IFF IN$IMG .IFT L$IMGP .ASK [OU$IMG] OU$IMG Is the output disk in BRU image format .IFT .GOTO HELPIO .; .; Recompute whether we are serial media, as the user may have .; selected BRU backup format for either input or output disk. .; .SETL IN$SER IN$IMG!#IN$DSK .SETL OU$SER OU$IMG!#OU$DSK .; .; Also tinker with any switch defaults that depend on .; whether we are serial media. .; .IFT OU$SER .SETT V$PR ! If output image or tape, no /-PR. .IFT OU$SER .SETF V$UF ! If output image or tape, no /UF. .IFT OU$SER .SETN V$IN 0. ! If output image or tape, no /IN. .IFT OU$SER .SETN V$MX 0. ! If output image or tape, no /MX. .; .; A backup set name is legal only if either the input or the .; output device is serial (meaning either tape or BRU image). .; .INQIBK:.SETL L$Q IN$SER!OU$SER .SETS S$Q V$BK .IFT L$Q .ASKS [0:12.:V$BK] V$BK What backup set name .IFT .GOTO HELPBK .; .; Specifying exclusion of the named input files only makes .; sense if input files were specified. .; .INQIEX:.SETL L$Q V$EX .IF IN$FIL <> "" .ASK [V$EX] V$EX Shall I exclude the named files .IFT .GOTO HELPEX .; .; Preservation of file IDs is a possibility only if output .; is not to serial media (tape or BRU image) and not to .; a disk mounted FILES-11. .; .INQIPR:.SETL L$Q V$PR .IFF OU$F11 .IFF OU$SER .ASK [V$PR] V$PR Shall I preserve file IDs .IFT .GOTO HELPPR .; .; As the user may have changed the default on the above .; question, recompute the index file limit if needed. .; .IFF V$PR .IF O$IXLM = 0 .GOSUB MAX V$MX O$IXLM 'OU$DEV' .; .; Specifying the maximum number of file IDs is only possible .; if output is not to serial media (tape or BRU image) and .; not to a disk mounted FILES-11, and file IDs are not being .; preserved. .; .INQIMX:.SETN N$Q V$MX .IFF OU$SER .IFF OU$F11 .IFF V$PR .ASKN [16.:O$IXLM:V$MX] V$MX Enter the maximum files on this volume .IFT .GOTO HELPMX .; .; Specifying the initial number of file IDs is only possible .; if output is not to serial media (tape or BRU image) and .; not to a disk mounted FILES-11, and file IDs are not being .; preserved. If no value was specified, a default must be .; supplied. The value must be clamped to the allowed limits .; in any case. .; .SETN V$IN N$INVL .IFT OU$DSK .IFF V$PR .IF V$IN = 0 .GOSUB INI V$IN 'V$MX%D'. .IF V$IN > V$MX .SETN V$IN V$MX .IF V$IN < 16. .SETN V$IN 16. .INQIIN:.SETN N$Q V$IN .IFT OU$DSK .IFF V$PR .ASKN [16.:V$MX:V$IN] V$IN Enter the initial index file allocation .IFT .GOTO HELPIN .; .; Rewinding the tape is only a possibility if either .; input or output is not to disk. .; .INQIRW:.SETL L$Q V$RW .IFF IN$DSK .OR .IFF OU$DSK .ASK [V$RW] V$RW Shall I rewind the tape .IFT .GOTO HELPRW .; .; Specifying the media density is optional of the input medium .; is tape, required if output medium is tape, impossible .; otherwise. .; .INQIDE:.SETN N$Q V$DE .SETS S$DRVR IN$DEV[1:2] .IFNDF DNS$'S$DRVR' .SETS S$DRVR OU$DEV[1:2] .IFNDF DNS$'S$DRVR' .GOTO NOINDN .PARSE DNS$'S$DRVR' "," S$DENS S$JUNK .IF S$DRVR = OU$DEV[1:2] .IF V$DE = 0 .SETN V$DE 'S$DENS'. .ASKN [::V$DE] V$DE What tape density .SETS S$DENS DNS$'S$DRVR' .IF S$DRVR = IN$DEV[1:2] .SETS S$DENS S$DENS+",0" .IFT .GOTO HELPDE .TEST ",'S$DENS'," ",'V$DE%D'," .IF <> 0 .GOTO NOINDN .SETN V$DE N$Q .DISABLE DISPLAY ; ; Error - Illegal density for an 'S$DRVR': device. ; You must select from the list 'S$DENS'. ; .ENABLE DISPLAY .GOTO INQIDE .NOINDN:.; .; .; Creating new directories is only possible on a mounted .; output disk that is not being used to create a BRU image. .; .INQIUF:.SETL L$Q V$UF .IFF OU$SER .IFT OU$F11 .ASK [V$UF] V$UF Shall I create new directories where needed .IFT .GOTO HELPUF .; .; The output volume can ALWAYS be verified. .; .INQIVE:.SETL L$Q V$VE .ASK [V$VE] V$VE Shall I verify the output volume(s) .IFT .GOTO HELPVE .ENABLE LOWERCASE .; .; Now that we know what we are supposed to do, do it. .;// If you add a switch that modifies the command lines generated, .;// impliment it here. .; .DOIT: ; .; .; If needed, compute the initial and maximum index file entries. .; .IFT OU$DSK .IFF V$PR .IF V$MX = 0 .GOSUB MAX V$MX O$IXLM 'OU$DEV' .IFT OU$DSK .IFF V$PR .IF V$IN = 0 .GOSUB INI V$IN 'V$MX%D'. .; .; Build the BRU command line; .; .SETS S$BRU "BRU" .IFF IN$DSK .IFT V$RW .SETS S$BRU S$BRU+"/REW" .IFF IN$DSK .IF V$DE <> 0 .SETS S$BRU S$BRU+"/DEN:'V$DE%D'" .IFT IN$DSK .IFT IN$F11 .SETS S$BRU S$BRU+"/MOU" .IFT IN$IMG .SETS S$BRU S$BRU+"/IM:R" .IFT IN$SER .IF V$BK <> "" .SETS S$BRU S$BRU+"/BAC:"+V$BK .IFT V$EX .SETS S$BRU S$BRU+"/EXC" .IFF OU$DSK .IFT V$RW .SETS S$BRU S$BRU+"/REW" .IFF OU$DSK .IF V$DE <> 0 .SETS S$BRU S$BRU+"/DEN:'V$DE%D'" .IFF OU$DSK .IFF V$RW .SETS S$BRU S$BRU+"/APP" .IFT OU$DSK .IFF OU$F11 .SETS S$BRU S$BRU+"/INI" .IFT OU$DSK .IFT OU$F11 .SETS S$BRU S$BRU+"/NOINI" .IFT OU$DSK .IFF V$PR .SETS S$BRU S$BRU+"/NOPRE" .IFT OU$DSK .IFF V$PR .SETS S$BRU S$BRU+"/HEA:'V$IN'/MAX:'V$MX'" .IFT OU$IMG .SETS S$BRU S$BRU+"/IM:S" .IFT OU$SER .IF V$BK <> "" .SETS S$BRU S$BRU+"/BAC:"+V$BK .IFT OU$DSK .IFT OU$F11 .IFT V$UF .SETS S$BRU S$BRU+"/UFD" .IFT V$VE .SETS S$BRU S$BRU+"/VER" .; .; Pick up the start time for the BRU run. .; .PARSE