.; INCBUP.IND, IND control file. .; .; Performs an INCremental BackUP, according to the date of the .; previous last backup. .; .; Refer to INDFIL.DOC for instructions and definitions. .; .; First parameter is SOURCE VOLUME .; (If SOURCE is a file name, the LD unit is requested - if it is .; already mounted, that unit is the default). .; Second parameter is BACKUP VOLUME .; (If BACKUP is a LD, a physical device is requested). .; Third parameter is DATE OF BACKUP. .; .; Version 2 gives unique file names to subdevices used for .; backups, so several can be put on one physical device. .; Version 3 now checks disk size to be sure files will fit. .; Version 4 includes cataloging by DSKLIB, and better MULTIVOLUME .; verification. .; Version 5 allows easy backup of logical devices by allowing you .; to specify them by file name. Date of last backup is reported, .; and multiple backups can be done at one INCBUP session. .; Version 6 changed to allow file or device names to be entered. .; Also doesn't ask the same questions on multiple backups in one .; session. .; Version 7 adds /EXclude:filespecs switch to the device or filename .; to be backed up. Exclude filespecs are any legal RT-11 specification .; such as /EX:*.DAT,*.OBJ or /EX:TSX*.TSX. Limitations on this feature .; are: maximum 3 filespecs, no factoring, no parentheses. .; Directory output now may be to any printer (LP, LS, SP, CLn) or .; spooler. .; If another volume is needed as a backup target, it is checked and .; initialized, if desired. .; .; NOTE... The IND control file PARSE.IND must be on SY:, and the .; program READLD.SAV must also be on SY:. The logical name WF: .; must be assigned to some device. This file uses DSKLIB (DECUS .; library submission #11-743) and UCL+ (DECUS #11-746). .; .sets IBVER "7.6" .;Version of 25-May-88. .; .; Written by: R. W. Barnard .; BIO/Comp Applications .; P. O. Box 18007 .; Albuquerque, NM 87185 .; .enable quiet .enable global .; .; ********* Start of User-Changeable Setup Parameters ****** .; .; Change the volume initialization owner name here. .sets OWNAME "R W Barnard" .; .; Change the default SOURCE VOLUME here. .sets SRV "SY:" .; .; Change the default BACKUP VOLUME here. .sets BKV "LD4:" .; .; Change the default BACKUP DEVICE here (used if BKV is an LD unit). .sets BKD "DL0:" .; .sets BKD "DU1:" .; .; Change the default device for logical disk files being backed up here. .sets $DEFDV "DU3:" .; .sets $DEFDV "DU0:" .; .; Change the default extension for logical disk files here. .sets $DEFXT ".DSK" .; .; Specify the assignment of your work device here. .;ASSIGN VM WF .; .; Specify the print device here. (May be LP, LS, SP0, CLn, etc). .; NOTE - Don't include a : in the specification!! .; .sets PRIDEV "SP0" .;For RT-11 .sets PRIDEV "LS" .;For TSX+. (The Datasouth printer). .; .; Set up the printer here. (Comment these out if not desired). .sets EPOFF "1" .;Turn off 's between directories. .sets EPON "1" .sets FFEND "1" .;Do a final . .; .; Note to TSX+ users - It is not easy to tell at runtime if SL is ON. .; Therefore, if you want SL to be on at the conclusion of this procedure, .; uncomment the following line. .sett SLON .; .; Change the name of the DSKLIB catalog file here. .sets DLBCAT "DU0:INCBUP" .; .; Change the name of the file to remember DSKLIB catalog numbers here. .sets DLBFIL "DU0:INCBUP.DAT" .; .; ********* End of User-Changeable Setup Parameters ****** .; .disable lowercase .disable octal .disable prefix, suffix .enable escape .; .sets FFCMD "EJECT" .;UCL+ symbol for page eject. .; .; Clear the screen. ; ; ; INCBUP - RT-11 Incremental file backup, Version 'IBVER' .; .; Exiting instructions to the user. ; ; You may stop the command file by typing ; in answer to any question. ; .ifdf EPOFF SET 'PRIDEV' ENDPAG=0 .; SET TT QUIET .ifndf SLON .setf SLON .ifloa SL .sett SLON .start: .asks [::"'SRV'"] SOURCE Enter the volume to be backed up ['SRV']: .ift .goto quit .parse SOURCE "/" SOURCE SRSWCH .sets EXCLFL "" .if eq 1 .goto s30 .;No switch was used. .test SRSWCH "EX" .if eq 1 .goto s20 .;The first 2 characters are EX. .; .s10: ; Ignoring the switch /'SRSWCH' .goto s30 .s20: .parse SRSWCH ":" A1 EXCLFL .if ne 2 .goto s10 .sets EXCLFL ","+EXCLFL .s30: @SY:PARSE.IND 'SOURCE' .if $DEV eq "NSD" .goto start .;Bad device. .if $FILNM eq "" .goto disk .;Must have given a real device. .; .testfile '$FILSP' .if eq .goto 10 .;The file exists. ; ;The file '$FILSP' was not found. .goto start .; .10: R READLD .if ne .goto 20 .;We know that no LDs are mounted. .openr WF:LDLGCL.TMP .ldloop: .read LINE .parse LINE " " LDINUS A1 A2 .if A1 eq $FILSP .goto 30 .if LDINUS eq "" .or .if LDINUS eq "No" .goto 20 .goto ldloop .; .20: .setn L1 0 .;Find the first unused LD unit number. .ifdf LDINUS .erase local LDINUS .;No LD unit in use. .ldlp: .testdevice LD'L1' .parse "," A2 A1 A1 A1 A1 A1 A1 A3 A1 .if A2 ne "NSD" .goto 25 .sets A2 "LD'L1'" .goto 40 .25: .inc L1 .if L1 eq 8. .goto nolds .if A3 eq "MTD" .goto ldlp .goto 40 .; .30: .sets A2 LDINUS .;Use the LD unit number already assigned. .40: .close .asks [0:4:"'A2'"] CURLD What LD unit do you want to use for backing up '$FILNM' ['A2']? .ift .goto quit .if ge 3 .sets CURLD "LD"+CURLD[3:3]+":" .if eq 1 .sets CURLD "LD"+CURLD+":" .; .sets LDLOG $FILNM[1:3] .;Try to use 1st 3 chars as logical name ; The backup set identifier will be "'LDLOG'" .ask [] QQ Is this OK [Y] .ift .goto quit .iff QQ .asks [1:3] LDLOG Then enter the identifier: .ift .goto quit .; MOUNT 'CURLD' '$FILSP' 'LDLOG' .sets SRCVOL LDLOG ASSIGN 'CURLD' INP .goto 50 .; .disk: .parse SOURCE ":" SOURCE A2 .sets SRCVOL SOURCE .sets LDINUS "1" .;Need to define it anyway. ASSIGN 'SOURCE' INP .50: .sets BVOL SRCVOL .;Save the exact name. .test SRCVOL .if eq 3 .goto 60 .;Must make sure it is exactly .sets BLANKS " " .;3 characters. .sets SRCVOL SRCVOL+BLANKS['':2] .; .60: .ifdf REPEAT .goto r10 .ifdf LASBAK .goto 70 .testfile 'DLBFIL' .if ne .gosub dsknum .openr 'DLBFIL' .read LASBAK .read LASBAK .;Get the date of the last backup. .close .70: ; ; The last backup was done on 'LASBAK' .ifdf STRTDT .goto 80 .;We already have a start date. .parse LASBAK "-- " DAY MON YR A1 .;The following is an attempt at automatically picking the date for LASDAT. .setn L1 'DAY'+1. .sets STRTDT "'L1'-'MON'-'YR'" .80: .asks [0:9.:"'STRTDT'"] LASDAT Enter the starting date for this backup ['STRTDT']: .ift .goto quit .test LASDAT "-" .;Find out if - was typed in date .if eq 0 .goto 90 .;instead of :. .parse LASDAT "-" A1 A2 A3 .if A2 ne "" .sets LASDAT A1+":"+A2 .if A3 ne "" .sets LASDAT LASDAT+":"+A3 .90: .sets STRTDT LASDAT .;Use the date just entered next time. .; .parse "-" DAY MON YR .r10: .gosub trnmon DIR/BRI/OUT:WF:INCBUP/SINCE:'LASDAT'/EXCL INP:(*.BAK,*.DSK,*.TMP'EXCLFL') .openr WF:INCBUP.DIR .read LINE .;Read the date line. .loop: .read LINE .;Read the remainder of the directory. .parse LINE "," FILES BLOCKS .if BLOCKS eq "" .goto 100 .parse FILES " " A1 NUMFIL A2 .parse BLOCKS " " A1 BLKSIZ A2 .goto 110 .; .100: .iff .goto loop .110: .close .if BLKSIZ eq "0" .goto nuttin .; ; ; You have 'BLKSIZ' blocks, 'NUMFIL' files to be backed up. ; .setn SEGSIZ 'NUMFIL'/70+1 .ifdf REPEAT .goto r20 .asks [0:4:"'BKV'"] BKVOL Enter the backup target volume ['BKV']: .ift .goto quit .; Get rid of any : that may have been typed. .parse BKVOL ":" BKVOL A2 .; .; Create the file to initialize the output volume. .r20: .openr #2 'DLBFIL' .read #2 DSKNUM .close #2 ASSIGN 'BKVOL' OUP .enable lowercase .open WF:INITD.COM .enable data R DUP OUP:/Z/V/Y/N:'SEGSIZ' 'DSKNUM'Bak'SRCVOL''MO''DAY' 'OWNAME' ^C DELETE/NOQ WF:INITD.COM .disable data .close .disable lowercase .sets MULCOP "" .; .sets DEVNAM BKVOL[1:2] .;Get the 1st 2 chars of device name. .if DEVNAM ne "LD" .goto 150 .; .; ***Backup to Logical Devices*** .; .ifdf REPEAT .goto r30 .asks [0:4:"'BKD'"] BKPDEV Enter the backup device for the logical disk ['BKD']: .ift .goto quit .parse BKPDEV ":" BKPDEV A3 .sets BKD BKPDEV .;Might as well change the default to current. .r30: .setn BKPSIZ 'BLKSIZ'.+6+(2*'SEGSIZ') .; .dsksiz: .gosub dskchk .if MAXSIZ ge BKPSIZ .goto 120 ; .ask QQ Your files won''t fit on this volume. Put in another and press .ift .goto quit .goto dsksiz .; .120: .sets BKUFIL "'BKPDEV':BAK'BVOL'.'MO''DAY'" .testfile 'BKUFIL' .if ne .goto 140 ; .ask [] QQ File 'BKUFIL' exists... Delete it [N]? .iff QQ .goto 130 UNPROT 'BKUFIL' DELETE/NOQUERY 'BKUFIL' .goto 140 .; .130: .ask QQ Put in another volume and press .ift .goto quit .goto dsksiz .; .140: CREATE 'BKUFIL'/ALL:'BKPSIZ' MOUNT 'BKVOL' 'BKUFIL' .; .; Make the file to run the DSKLIB cataloger. .open WF:DSKLIB.COM .data R DLBCOM .data O'DLBCAT' UF'BKUFIL' Q .close ; ; Initializing the backup volume ('BKVOL') now. $@WF:INITD.COM .goto 180 .; .; ***Backup to a Physical device*** .; .150: .sets BKPDEV BKVOL ; .ask [] QQ Do you want to initialize the backup device [Y]? .ift .goto quit .iff QQ .goto 160 $@WF:INITD.COM .160: .gosub dskchk .setn BLKN 'BLKSIZ' .if MAXSIZ ge BLKN .goto 170 .sets MULCOP "/MULTIVOL" ; Must do a multivolume backup. .; .flpchk: ; Check the next volumes which you will need... .ask QQ Insert the next volume in the drive and press .ift .goto quit .gosub dskchk .ask QQ Do you want to check another volume [N] .ift QQ .goto flpchk ; ; Now put back the FIRST volume. .ask QQ Press to continue .ift .goto quit .; .; Make the file to run the DSKLIB cataloguer. .170: .open WF:DSKLIB.COM .data R DLBCOM .data OSY:INCBUP UF'BKVOL': Q .close .; .180: DELETE/NOQ WF:INCBUP.DIR ; ; Copying the files to the backup volume now. COP/SIN:'LASDAT'/INFO/EXC/NOLOG'MULCOP'/SYS INP:(*.BAK,*.DSK,*.TMP'EXCLFL') OUP: SET SL OFF .; .; Do different things depending on MULCOP. .if MULCOP ne "" .goto 190 ; ; Verifying the files on the backup volume now. COPY/SYSTEM/NOLOG OUP:*.* NL: ; ; Cataloging the backed-up files now. $@WF:DSKLIB DIRECTORY/OUT:'PRIDEV':/VOLUME OUP: .if DEVNAM eq "LD" DISMOUNT 'BKVOL' .ifdf LDINUS .goto 210 DISMOUNT 'CURLD' .goto 210 .; .190: ; ; Verifying the backup output volumes now. ; Start with the first volume in the sequence. ; Type with no volume in 'BKVOL' when all have been verified. .setn L1 1 .vfylp: ; .ask QQ Put volume 'L1' in drive 'BKVOL' and press .testdevice OUP .parse "," A2 A2 A2 A2 A2 A2 ONLINE A2 .if ONLINE ne "ONL" .goto 210 COPY/SYSTEM/NOLOG OUP:*.* NL: .if L1 eq 1 .goto 200 .; .setn DN 'DSKNUM' .;Need to give vol ID to second and later .inc DN .;disks. .sets DSKN "'DN'" .gosub longnm .open WF:DSKLIB.COM .enable data R DLBCOM O'DLBCAT'VF'BKVOL':'DSKN'Bk'DSKN''SRCVOL'.'MO''DAY'/OWUF'BKVOL':Q .disable data .close .200: ; ; Cataloging the backed-up files now. $@WF:DSKLIB DIRECTORY/OUT:'PRIDEV':/VOLUME OUP: .inc L1 .goto vfylp .; .210: .ift SLON SET SL ON .; Increment the number for DSLKIB. .setn DN 'DSKNUM' .inc DN .sets DSKN "'DN'" .gosub longnm .; Write the latest DSKLIB disk number in a file for use next time. .open #2 'DLBFIL' .data #2 'DSKN' .data #2 '' at '