.; INCBUP.IND, IND control file. .; .; First parameter is SOURCE VOLUME .; (If SOURCE is a LD, the file name and logical name are requested). .; Second parameter is BACKUP VOLUME .; (If BACKUP is a LD, device is requested). .; Third parameter is DATE OF BACKUP .; Refer to INDFIL.DOC for instructions and definitions. .; .; 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. .; .sets IBVER "5.3" .; Version 5.3, 20-Oct-86. .; .; Written by: R. W. Barnard .; BIO/Comp Applications .; P. O. Box 5342 .; Albuquerque, NM 87185 .; .disable lowercase,octal .disable prefix .enable escape .enable quiet SET TT QUIET .; .; Change the assignment of your work device here. ASSIGN VM WF .; Change the name of the file to remember DSKLIB catalog numbers here. .sets DLBFIL "SY:INCBUP.DAT" .; 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 for backing up to LD's). .sets BKD "DU1" .; .; 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. .start: ; .; .asks [0:4:"'SRV'"] SOURCE Enter the volume to be backed up .ift .goto quit .sets A1 SOURCE[1:2] .;See if we want to back up a LD. .disable suffix .if A1 ne "LD" .goto 10 .;No - go on. .; .bkld: .asks LDFIL What is the file name .ift .goto quit .;Get the file name. .if LDFIL eq "" .goto bkld .; .parse LDFIL ":" A2 FN .if FN eq "" .sets FN A2 .;No device given. .sets LDLOG FN[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 LDLOG Then enter the identifier .ift .goto quit .; MOUNT 'SOURCE' 'LDFIL' 'LDLOG' .if ne .goto bkld .;No file? .sets SRCVOL LDLOG .goto 20 .; .10: .parse SOURCE ":" SOURCE A2 .sets SRCVOL SOURCE .20: .sets BVOL SRCVOL .;Save the exact name. .test SRCVOL .if eq 3 .goto 21 .;Must make sure it is exactly .sets BLANKS " " .;3 characters. .sets SRCVOL SRCVOL+BLANKS['':2] .21: ASSIGN 'SOURCE' INP .; .ifdf LASBAK .goto 22 .testfile 'DLBFIL' .if ne .gosub dsknum .openr 'DLBFIL' .read LASBAK .read LASBAK .;Get the date of the last backup. .close .22: ; ; The last backup was done on 'LASBAK' .ifdf STRTDT .goto 23 .;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 D1 'DAY'+1. .sets STRTDT "'D1'-'MON'-'YR'" .23: .asks LASDAT Enter the starting date for this backup ['STRTDT'] .ift .goto quit .if LASDAT eq "" .sets LASDAT STRTDT .test LASDAT "-" .;Find out if - was typed in date .if eq 0 .goto 25 .;instead of :. .parse LASDAT "-" L1 L2 L3 .if L2 ne "" .sets LASDAT L1+":"+L2 .if L3 ne "" .sets LASDAT LASDAT+":"+L3 .25: .enable suffix .sets STRTDT LASDAT .;Use the date just entered next time. .; .parse "-" DAY MON YR .gosub trnmon DIR/BRI/OUT:WF:INCBUP/SINCE:'LASDAT'/EXCLUDE INP:*.(BAK,DSK,TMP) .openr WF:INCBUP.DIR .read DIRREC .;Read the date line. .loop: .read DIRREC .;Read the remainder of the directory. .parse DIRREC "," FILES BLOCKS .if BLOCKS eq "" .goto 30 .parse FILES " " A1 NUMFIL A2 .parse BLOCKS " " A1 BLKSIZ A2 .goto 40 .; .30: .iff .goto loop .40: .close .if BLKSIZ eq "0" .goto nuttin .; ; ; You have 'BLKSIZ' blocks, 'NUMFIL' files to be backed up. ; .setn SEGSIZ 'NUMFIL'/70+1 .asks [0:4:"'BKV'"] BKVOL Enter the backup target volume .ift .goto quit .; Get rid of any : that may have been typed. .50: .parse BKVOL ":" BKVOL A2 .; ASSIGN 'BKVOL' OUP .; Create the file to initialize the output volume. .openr #2 'DLBFIL' .read #2 DSKNUM .close #2 .enable lowercase .open WF:INITD.COM .enable data R DUP OUP:/Z/V/Y/N:'SEGSIZ' 'DSKNUM'Bak'SRCVOL''MO''DAY' 'OWNAME' ^C .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 100 .; .; ***Backup to Logical Devices*** .; .asks [0:4:"'BKD'"] BKPDEV Enter the backup device for the logical disk .ift .goto quit .60: .parse BKPDEV ":" BKPDEV A3 .sets BKD BKPDEV .;Might as well change the default to current. .setn BKPSIZ 'BLKSIZ'.+6+(2*'SEGSIZ') .; .disable suffix .dsksiz: .gosub dskchk .if MAXSIZ ge BKPSIZ .goto 70 ; .ask QQ Your files won''t fit on this disk. Put in another and type .ift .goto quit .goto dsksiz .; .70: .enable suffix .sets BKUFIL "'BKPDEV':BAK'BVOL'.'MO''DAY'" .testfile 'BKUFIL' .if ne .goto 90 ; .ask [] QQ File 'BKUFIL' exists... Delete it .iff QQ .goto 80 UNPROT 'BKUFIL' DELETE/NOQUERY 'BKUFIL' .goto 90 .; .80: .disable suffix .ask QQ Put in another disk and type .ift .goto quit .enable suffix .goto dsksiz .; .90: CREATE 'BKUFIL'/ALL:'BKPSIZ' MOUNT 'BKVOL' 'BKUFIL' .; .; Make the file to run the DSKLIB cataloger. .open WF:DSKLIB.COM .data SET TT QUIET .data R DLBCOM .data OSY:INCBUP UF'BKUFIL' Q .close ; ; Initializing the backup volume ('BKVOL') now. $@WF:INITD.COM .goto 130 .; .; ***Backup to a Physical device*** .; .100: .sets BKPDEV BKVOL ; .ask [] QQ Do you want to initialize the backup device .ift .goto quit .iff QQ .goto 110 $@WF:INITD.COM .110: .gosub dskchk .setn BLKN 'BLKSIZ' .if MAXSIZ ge BLKN .goto 120 .sets MULCOP "/MULTIVOL" ; Need to do a multivolume backup. .; .; Make the file to run the DSKLIB cataloguer. .120: .open WF:DSKLIB.COM .data SET TT QUIET .data R DLBCOM .data OSY:INCBUP UF'BKVOL': Q .close .; .130: DELETE/NOQ WF:INCBUP.DIR DELETE/NOQ WF:INITD.COM ; ; Copying the files to the backup volume now. COPY/SINCE:'LASDAT'/INFORM/EXCLUDE/NOLOG'MULCOP'/SYS INP:*.(BAK,DSK,TMP) OUP: .setf SLON .ifloa SL .sett SLON SET SL OFF .; .; Do different things depending on MULCOP. .if MULCOP ne "" .goto 140 ; ; Verifying the files on the backup volume now. COPY/SYSTEM/NOLOG OUP:*.* NL: ; ; Cataloging the backed-up files now. $@WF:DSKLIB DIRECTORY/PRINTER/VOLUME OUP: .if DEVNAM eq "LD" DISMOUNT 'BKVOL' .ifdf LDFIL DISMOUNT 'SOURCE' .ifdf LDFIL .erase local LDFIL .goto 160 .; .140: ; ; Verifying the backup output volumes now. ; Start with the first disk in the sequence. ; Type with no disk in 'BKVOL' when all have been verified. .setn DSKCNT 1 .disable suffix .vfylp: ; .ask QQ Put disk 'DSKCNT' in drive 'BKVOL' and type .testdevice OUP .parse "," A1 A2 A3 A4 A5 A6 ONLINE MOUNT .if ONLINE ne "ONL" .goto 160 COPY/SYSTEM/NOLOG OUP:*.* NL: .if DSKCNT eq 1 .goto 150 .; .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 OSY:INCBUPVF'BKVOL':'DSKNUM'Bk'DSKCNT''SRCVOL'.'MO''DAY'/OWUF'BKVOL':Q .disable data .close .150: ; ; Cataloging the backed-up files now. $@WF:DSKLIB DIRECTORY/PRINTER/VOLUME OUP: .inc DSKCNT .goto vfylp .; .160: .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 'DSKNUM' .data #2 '' at '