.ENABLE SUBSTITUTION
.ENABLE QUIET
.ENABLE GLOBAL
PAGE
.WAIT CCL
.WAIT TCF
.SETS $UIC <UIC>
.SETS $SYDSK <SYDISK>
.SETN $UNIT <SYUNIT>
SET /UIC=[1,7]
.SETF NEW
.SETF DIE
.SETS DK0 "DK0:"
.SETS DK1 "DK1:"
.SETS DK2 "DK2:"
.SETS DK3 "DK3:"
.SETS DK4 "DK4:"
.SETS DK5 "DK5:"
.SETS CR ""
.5:.ASKS DSK ENTER THE DISK DRIVE WITH THE FILES TO BE BACKED UP(DDU)
.SETS DISK DSK[1:3]+":"
.IF DISK EQ DK0 .GOTO 7
.IF DISK EQ DK1 .GOTO 7
.IF DISK EQ DK2 .GOTO 7
.IF DISK EQ DK3 .GOTO 7
.IF DISK EQ DK4 .GOTO 7
.IF DISK EQ DK5 .GOTO 7
.GOTO 5
.7:
.ASKS DSKNAM WHAT IS THE NAME OF THE DISK
.ASKS TAPNAM ENTER THE NAME OF THE BRU MAG TAPE
.ASK NEW START A NEW BRU TAPE
.IFT NEW .SETS REWIND "/REW"
.IFF NEW .SETS REWIND ""
.IFT NEW .SETS APPEND ""
.IFF NEW .SETS APPEND "/APP"
.IFT NEW PIP DK1:'TAPNAM'.BRU;*/DE/NM
.IFF NEW PIP TI:=DK1:'TAPNAM'.BRU
.IFF NEW .IF <EXSTAT> NE 1 .SETT DIE
.IFT DIE .DISABLE QUIET
.IFT DIE ; NO RECORD EXISTS OF A PREVIOUS BACKUP WITH THIS TAPE NAME
.IFT DIE ; PERCHANCE, THE TAPE NAME IS WRONG. -- EXITING
.IFT DIE /
.IFF NEW .ASKN[1:100] NVERSN WHAT IS THE NEXT VERSION NUMBER
.IFT NEW .SETN NVERSN 1
.SETS $VERSN "'NVERSN'"
.SETS BCKSET DSKNAM+".BCK;"+$VERSN
.10:.ASKS $DATE WHAT IS THE DATE TO BACKUP AFTER(DD-MMM-YY)
.IF $DATE EQ CR .SETS $DATE "01-JAN-76"
.SETS $TDATE <DATE>
 
 
.OPEN DK1:BRUBACKUP.CMD;1
.DATA /DEN:800'REWIND''APPEND'/MOUNTED-
.DATA /INVOLUME:'DSKNAM'-
.DATA /BACKUP_SET:'BCKSET'/REVISED:AFTER:'$DATE' 'DISK'[*,*]*.*;* MM0:
.CLOSE
 
 
.IFNINS BRU INS DK5:[1,53]BRU/TASK=...BRU
ALL MM0:
.IF <EXSTAT> NE 1 .SETT DIE
.IFT DIE .DISABLE QUIET
.IFT DIE ; MAG TAPE COULD NOT BE ALLOCATED -- EXITING
.IFT DIE .EXIT
.SETS STTIM <TIME>
BRU @DK1:BRUBACKUP.CMD
.SETS STPTIM <TIME>
.IF <EXSTAT> NE 1 .DISABLE QUIET
.IF <EXSTAT> NE 1 ; FATAL BACKUP ERROR, EXIT STATUS = '<EXSTAT>'
.IF <EXSTAT> NE 1 .GOTO EEXIT
REM BRU
.SETS FILNAM "DK1:"+TAPNAM+".BRU"
.SETF FILEIS
.IFEXI 'FILNAM' .SETT FILEIS
.IFT FILEIS .OPENA 'FILNAM'
.IFF FILEIS .OPEN 'FILNAM'
.IFF FILEIS .DATA TAPE    DISK_NAME  VERSION   BACKUP DATES	STRT, STP TIME
.DATA 'TAPNAM'  'DISK''DSKNAM'  'NVERSN'    '$DATE' - '$TDATE' ('STTIM' - 'STPTIM')
.CLOSE
.EEXIT:
.IFINS BRU REM BRU
PIP DK1:BRUBACKUP.CMD;1/DE
PIP 'FILNAM'/TR
.500:DEA MM0:
SET /UIC='$UIC'
ASN  '$SYDSK''$UNIT':=SY:
REWIND
