; This is the original copy of BRUWORK.CMD as it appeared in the January 1988
; issue of DEC Professional, page 70.
; Date:  May 10, 1988
;
ALLOCATE MU0:
;
;	This is BRUWORK.CMD.  Please insure that a tape is installed on
;	the system tape drive.  If a tape is not installed, and you run
;	this command file, the system may lock up.  If the system locks
;	up, it will have to be crashed and rebooted.
;
.ASK	NULL	Is a tape installed on the tape drive...
.IFF	NULL	.GOTO 999
.ENABLE SUBSTITUTION
.DISABLE LOWERCASE
.SETS	UFD	"'<UIC>'"
.SETS	DEV	"'<SYDISK>''<SYUNIT>':"
.001:
CLR
.002:
;
;			THIS IS THE MAIN MENU
;		CHOOSE ONE OF THE FOLLOWING OPTIONS:
;
;	L   (LIST)	LIST THE CONTENTS OF A BRU CREATED TAPE
;	B   (BACKUP)    BACKUP FILES FROM DISK TO TAPE
;	R   (RECOVER)   RECOVER FILES FROM TAPE TO DISK
;	S   (SUPERUSER) SYSTEM MANAGER OPTIONS
;	E   (EXIT)      EXIT FROM THIS COMMAND FILE
;
.ASKS	OPTION	ENTER YOU CHOICE...
.IF	OPTION = "E"  .GOTO 999
.IF	OPTION = "L"  .GOTO 200
.100:
CLR
.101:
;
;			THIS IS THE LISTING SUB-MENU
;      		    CHOOSE ONE OF THE FOLLOWING OPTIONS:
;
;	B    (BACKUP SETS) LIST THE BACKUP SET NAMES ON YOUR TAPE
;	F    (FILES)       LIST THE FILES FOR YOUR TAPE AND BACKUP SET
;	E    (EXIT)        RETURN TO THE MAIN MENU
;
.ASKS	LISOPT  ENTER YOUR CHOICE...
.IF	LISOPT = "E"   .GOTO 001
.IF	LISOPT <> "B"  .GOTO 120
CLR
BRU /REW/DIR MU0:
.GOTO 101
.120:
.IF	LISOPT <> "F"  .GOTO 130
.GOSUB 802
CLR
BRU /REW/BAC:'BNAME'/DIR   MU0:
.GOTO 101
.130:
.GOSUB 800
.GOTO 101
.200:
.IF	OPTION <> "B"   .GOTO 300
CLR
.201:
;
;			THIS IS THE BACKUP SUB-MENU
;		   CHOOSE ONE OF THE FOLLOWING OPTIONS:
;
;	D   (DIRECTORY) BACKUP YOUR ENTIRE DIRECTORY TO TAPE
;	F   (FILES)     BACKUP SPECIFIED FILES TO TAPE
;	E   (EXIT)      RETURN TO THE MAIN MENU
;
.ASKS	BACOPT   ENTER YOUR CHOICE...
.IF	BACOPT = "E"   .GOTO 001
.IF	BACOPT <> "D"  .GOTO 220
.GOSUB 807
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' 'DEV' 'UFD' MU0:
.GOTO 200
.220:
.IF	BACOPT <> "F"   .GOTO 230
.GOSUB 807					! GETS TNAME,BNAME,QUAL
.GOSUB 803					! GETS SPEC
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' 'DEV' 'UFD' 'SPEC' MU0:
.GOTO 200
.230:
.GOSUB 800
.GOTO 201
.300:
.IF	OPTION <> "R"   .GOTO 400
CLR
.301:
;
;			THIS IS THE RECOVER SUB-MENU
;		    CHOOSE ONE OF THE FOLLOWING OPTIONS:
;
;	B   (BACKUP SET) RECOVER ALL FILES FROM A BACKUP SET
;	F   (FILES)      RECOVER SPECIFIED FILES FROM A BACKUP SET
;	E   (EXIT)       RETURN TO THE MAIN MENU
;
.ASKS	RECOPT   ENTER YOUR CHOICE...
.IF	RECOPT = "E"   .GOTO 001
.IF	RECOPT <> "B"  .GOTO 320
.GOSUB 808					! GETS TNAME,BNAME,QUAL
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' MU0: 'DEV' 'UFD'
.GOTO 300
.320:
.IF	RECOPT <> "F"   .GOTO 330
.GOSUB 808					! GETS TNAME,BNAME,QUAL
.GOSUB 803					! GETS SPEC
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' MU0: 'DEV' 'UFD' 'SPEC'
.GOTO 300
.330:
.GOSUB 800					! DOES MISTAKE MSG
.GOTO 301
.400:
.IF	OPTION <> "S"   .GOTO 500
CLR
.401:
;
;			THIS IS THE SUPERUSER SUB-MENU
;	 	      CHOOSE ONE OF THE FOLLOWING OPTIONS
;
;	A   EXIT TO THE MAIN MENU
;	B   BACKUP AN ENTIRE DISK TO TAPE
;	C   BACKUP ACCORDING TO CREATION DATE SPECIFICATION
;	D   BACKUP ACCORDING TO DIRECTORY SPECIFICATION
;	E   BACKUP ACCORDING TO FILE SPECIFICATION
;	F   RECOVER AN ENTIRE BACKUP SET
;	G   RECOVER ACCORDING TO DIRECTORY SPECIFICATION
;	H   RECOVER ACCORDING TO FILE SPECIFICATION
;
.ASKS	SUPOPT   ENTER YOUR CHOICE...
.IF	SUPOPT = "A"   .GOTO 001
.IF	SUPOPT <> "B"  .GOTO 420
.GOSUB 807					! GETS TNAME,BNAME,QUAL
.GOSUB 804					! GETS SDEV
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' 'SDEV' MU0:
.GOTO 400
.420:
.IF	SUPOPT <> "C"   .GOTO 430
.GOSUB 807					! GETS TNAME,BNAME,QUAL
.GOSUB 806					! GETS DATE,TEMP
.GOSUB 804					! GETS SDEV
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME'/CRE:'TEMP''DATE' 'SDEV' MU0:
.GOTO 400
.430:
.IF	SUPOPT <> "D"   .GOTO 440
.GOSUB 807					! GETS TNAME,BNAME,QUAL
.GOSUB 804					! GETS SDEV
.GOSUB 805					! GETS SUFD
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' 'SDEV''SUFD' MU0:
.GOTO 400
.440:
.IF	SUPOPT <> "E"   .GOTO 450
.GOSUB 807					! GETS TNAME,BNAME,QUAL
.GOSUB 804					! GETS SDEV
.GOSUB 805					! GETS SUFD
.GOSUB 803					! GETS SPEC
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' 'SDEV''SUFD''SPEC' MU0:
.GOTO 400
.450:
.IF	SUPOPT <> "F"   .GOTO 460
.GOSUB 808					! GETS TNAME,BNAME,QUAL
.GOSUB 804					! GETS SDEV
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' MU0: 'SDEV'
.GOTO 400
.460:
.IF	SUPOPT <> "G"   .GOTO 470
.GOSUB 808					! GETS TNAME,BNAME,QUAL
.GOSUB 804					! GETS SDEV
.GOSUB 805					! GETS SUFD
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' MU0: 'SDEV''SUFD'
.GOTO 400
.470:
.IF	SUPOPT <> "H"   .GOTO 480
.GOSUB 808					! GETS TNAME,BNAME,QUAL
.GOSUB 804					! GETS SDEV
.GOSUB 805					! GETS SUFD
.GOSUB 803					! GETS SPEC
BRU 'QUAL'/TAP:'TNAME'/BAC:'BNAME' MU0: 'SDEV'SUFD''SPEC'
.GOTO 400
.480:
.GOSUB 800					! DOES MISTAKE MSG
.GOTO 401
.500:
.GOSUB 800					! DOES MISTAKE MSG
.GOTO 002
.800:
CLR
;
;	YOU HAVE MADE AN INVALID CHOICE, TRY AGAIN.
;
.RETURN
.801:
;
;	What is the TAPE LABEL of your tape?
;	(The TAPE LABEL is limited to 6 characters)
;
.ASKS	TNAME   Enter the TAPE LABEL...
.RETURN
.802:
;
;	What is the BACKUP SET name you want to use?
;	(The BACKUP SET is limited to 12 characters)
;
.ASKS	BNAME   Enter the BACKUP SET name...
.RETURN
.803:
CLR
;
;	What FILE SPECIFICATION do you want to use?
;
;	A FILE SPEC has the form:	NAME.EXT;VER.
;
;	An '*' can be used as a WILDCARD to replace WHOLE WORDS.
;	Examples:  NAME.FTN;* or NAME.*;* or *.FTN;*
;
;	You may leave off parts of the FILE SPEC starting from
;	the right.  BRU treats any OMITTED part as a WILDCARD.
;
;	Thus NAME.FTN = NAME.FTN;* and NAME = NAME.*;*
;	and NO FILE SPEC AT ALL is the same as *.*;*
;
.ASKS	SPEC   Enter the FILE SPECIFICATION
.RETURN
.804:
;
;	What DISK are you transferring TO/FROM?
;	The DISK DEVICE CODE has the form:  DU#:
;
.ASKS	SDEV   Enter the DISK DEVICE CODE...
.RETURN
.805:
;
;	What USER DIRECTORY are you transferring TO/FROM?
;	The DIRECTORY must be entered in the form:  [#,#]
;	The "*" can be used as a WILDCARD to replace a "#"
;
.ASKS	SUFD   Enter the DIRECTORY...
.RETURN
.806:
;
;	What REFERENCE DATE do you want to use?
;	The DATE must be entered in the form   DD-MMM-YY
;
.ASKS	DATE   Enter the DATE...
.SETS	TEMP     "BEFORE:"
;
;	Are you transferring files created BEFORE or AFTER the
;	REFERENCE DATE?  This command file assumes you mean
;	files created BEFORE the REFERENCE DATE, unless you
;	answer "Y" for YES below.
;
.ASK	BORA	Backup files created AFTER the REFERENCE DATE...
.IFT	BORA	.SETS   TEMP	"AFTER:"
.RETURN
.807:
.GOSUB 801						! GETS TNAME
.GOSUB 802						! GETS BNAME
.SETS	QUAL	"/REW/MOU/APP"
;
;	Are you APPENDING to a tape or INITIALIZING it?
;	This command file assumes you are APPENDING
;	unless you answer "Y" for YES below.
;
.ASK	NEW	INITIALIZE the tape...
.IFT	NEW   .SETS	QUAL	"/REW/MOU"
.RETURN
.808:
.GOSUB 801						! GETS TNAME
.GOSUB 802						! GETS BNAME
.SETS	QUAL	"/REW/MOU/NOI"
.RETURN
.999:
DEALLOCATE MU0:
; 
; Note that CLR is a local assembly language utility.  It can be
; replaced with the line
;
;	<ESC>[P2J
;
;	which is the DEC VT100 Erase Display escape sequence of characters.

