April 29, 1988 IND Control Files DOWN, UP - For management of subdevices. _____ __ NEWLD - For creating new subdevice files. _____ INCBUP - For doing incremental backups of data. ______ INDFIL, PARSE - Utilities. _______ _____ Written by: R. W. Barnard BIO/Comp Applications P. O. Box 18007 Albuquerque, NM 87185 INTRODUCTION ____________ This submission consists of new files and files which have been substantially improved since they were previously submitted to the DECUS Library. Note... All these control files require that the logical name WF: be assigned to some device (VM: is a good choice). Furthermore, the files PARSE.IND and READLD.SAV must be present on SY:. These IND files have as their extensions .IND. You may patch IND.SAV to make this extension be the default. These files rely heavily on the User Command Linkage (UCL) fea ture of RT-11. In particular, they are written to take advanta- ges of the UCL+ program (available from the DECUS library as submission #11-746). Several UCL+ symbols are provided with this submission in the file INDFIL.UCJ. If you use no UCL, or the DEC-distributed UCL, you will need to modify INCBUP.IND to make it work under TSX+. DOWN, UP ____ __ The IND control files DOWN and UP can be used to conven- iently move among subdevices. Using these facilities, you can have subdirectories similar to those on a VAX. DOWN will mount a subdevice file using the Logical Disk (LD) handler and assign either the default (DK) or a user-selected logical name to that device. You may specify the LD number to be used, or accept the one automatically assigned. DOWN supports several levels of subdevices (i.e., a subdevice within a subdev- ice), with the default being two levels of nesting. If the device is not specified DOWN will search through a predetermined list of devices to look for the file. IND Control Files Page 2 DOWN uses PARSE, an IND procedure which is a comprehensive file spec parser. It also uses the program READLD to determine the LD units currently associated with files and the corresponding logi- cal assignments. The current file mounted by DOWN and the logical device name are stored in the file SY:CURDK.TMP. The file DOWN takes as arguments the file you want to go down to, an optional logical name and an optional LD unit number. If no file extension is given, .DSK will be assumed. If no device is specified, it will search a predetermined list of devices looking for the file. If a selected file is already associated with an LD, DOWN will use that LD unit instead of assigning another. UP moves back up one subdevice and reassigns all the logical device names assigned to the lower device to the upper one. If you currently are down two levels (in a subdevice inside another subdevice), UP will return you to the outer subdevice. UP reports the current location and logical device name in CURDK. By using READLD, UP is able to properly reassign logical names (under RT-11). HOME is a special case of UP which is implemented with a UCL+ symbol. HOME returns you from whatever depth of subdevice you are nested to SY as your default device and deassigns all logical names that were associated with the subdevice. OVER is a UCL+ symbol to move from one subdevice assignment to another. CUR is a UCL+ symbol to report what your current subdevice assignment is. The file INDFIL.UCJ provides UCL+ symbol defini- tions for DOWN, UP, HOME, OVER and CUR. The comments at the beginning of each file provide more information about the meanings of the parameters and the oper- ation of the files. DOWN should be edited to customize it to reflect the devices on your system. TSX+ Note... Because the logical device function and logical assignments are done differently in TSX+, UP and DOWN work slightly differ- ently under TSX+. The primary difference is that READLD fails completely if LD0 is not mounted (instead of just reporting that no logical disks are mounted). Consequently, LD0 must be as- signed before using DOWN. The symbol OVER doesn't work either. TSX+ gets confused by the sequence of operations alternating among IND, KMON and UCL+. Lastly, since logical assignments aren't stored in TSX+ where users can get at them, UP can't do as complete a job of deassigning logical names as it can under RT- 11. READLD ______ This is a Fortran-77 program. To rebuild it, you must link it with the routine ISTLD, from the TSXLIB library (DECUS library submission #11-490). The .SAV image provided was built on an 11/73, with a FPU. IND Control Files Page 3 NEWLD _____ The IND control file NEWLD can be used to easily create a new file to be used with the LD handler as a subdevice. The sub- device so created is integrated with UP and DOWN so that you can go UP or HOME from the subdevice created with NEWLD. NEWLD has five parameters - file name, size of file, logical name assignment when subdevice file is mounted, number of direc- tory segments, and whether the file is to be "net" or "gross" size. Defaults can be used for many of the parameters. The filespec parameter is parsed using SY:PARSE.IND, so if an incom- plete filespec is provided, defaults for the device and extension will be provided. File sizes can be specified in either of two ways - as a numerical value or as a "disk type", such as RX01, RX02, RX50, RL01, etc. The number of directory segments will be chosen by an algorithm or can be overridden when the file size is specified. Normally, when you give a file size, you will have the specified number of blocks available for use in the subdevice. The blocks for the directory will be added to the number of blocks you have requested; this is a specification of the "net" number of blocks. By using the "gross" parameter, the number of blocks you specify will include the subdevice directory. The file you create will therefore be the exact size specified by the NEWLD file size pa- rameter. When file sizes are specified by using a disk type, they are identical with files which would be created by the KMON command COPY/DEVICE/FILE. After the file is created it is mounted either as LD6 or LD7 (so that UP and HOME can be used) and initialized with the file name as volume ID. If you use NEWLD to try to create a file which already exists you will be warned, and asked if you want to go DOWN to that file. NEWLD should be edited to customize it for your install- ation. These include specifying the ownername for volume initialization and the default device for the new files. You may also modify or add to the list of disk types. Five disk types are currently defined: DX (494 blocks, 1 directory segment as default), DU (800 blocks, 4 segments), DY (988 blocks, 4 seg- ments), FW (2432 blocks, 7 segments - almost the same as RX33) and DL (10210 blocks, 16 segments). A logical name can be supplied; if not, the subdevice is as- signed DK. The file INDFIL.UCJ includes a symbol to invoke NEWLD. More information is contained at the start of the NEWLD listing. IND Control Files Page 4 INCBUP ______ INCBUP does incremental backups (i.e., backs up only files created since the previous backup) and catalogs the directories of the backed-up files for rapid location. Backups can be done from any size or type of disk (including LD's) to any other disk device. The backup target device can be a subdevice file on a larger disk, thereby permitting several "backup sets" to be on one physical disk. If you have more files than will fit on one physical volume, the copy operation will automatically be COPY/MULTIVOLUME. The devices on which the backed-up files are copied are identified by a unique name and extension as the "backup set identifier". For example, the volume ID of a floppy to which files from the system disk had been copied on June 23 would be BakSY .623; if the backed-up files from DL3 had instead been copied to a subdevice file on November 9, both the file name and the volume ID would be BakDL3.N09. The file cataloging is done by the program DSKLIB (DECUS Li- brary #11-743). Each backup volume is given a serial number used by DSKLIB for location purposes. The date of the last backup and the next DSKLIB serial number to be used is stored in the file INCBUP.DAT. As INCBUP executes, you are prompted for inputs. You are first prompted for the source volume; you may either specify a physical device (done by using up to 3 characters and a :), or a subdevice file. If you have specified a subdevice file, a three- character logical name, to be used in the backup set identifier will be chosen from the first three letters of the file name. If you don't like that logical name, you can specify another one- to three-character name. You may also exclude certain files from the backup by appending the /EXclude: switch to the device or file name. You may specify at most two filespecs for exclusion, such as *.SYS or TSX*.TSX. If you specify two filespecs, do so without using the RT-11 factoring convention - specify *.SYS,*.OBJ, not *.(SYS,OBJ). If the backup (target) volume is an LD, the device on which the subdevice file will reside is requested. You may specify default values for many of the parameters of the backup process. To do so, edit the appropriate part of INCBUP.IND. The following is a list of the parameters and defaults you may change: - The volume initialization owner name. - The default SOURCE VOLUME (the volume to be backed up). - The default BACKUP (target) VOLUME. - The default BACKUP target DEVICE (used if the BACKUP VOLUME is an LD unit). - The default device for LOGICAL DISK SOURCE VOLUMES being backed up. - The default EXTENSION for logical disk files. - The PRINT DEVICE for directories of the backup volumes. - Printer control functions. If you normally set ENDPAG=1, you can disable it so all the backup volume directories are printed without intervening form feeds. IND Control Files Page 5 - The name of the DSKLIB catalog file. - The name of the file to store DSKLIB catalog numbers and date of last backup. The incremental backup is done by doing a DIRECTORY/SINCE:xxxxxx and then copying only the files identified by that command. Files whose extensions are .BAK, .TMP and .DSK, (as well as any specified with a /EX switch) are not copied. Because the RT-11 DIR/SINCE:date command includes files created on the date speci- fied in the command, it is assumed that the backup should start on the next day. The date of the last backup is reported, and a simple-minded attempt to guess the date of the next day is done. (If your last backup was done on May 31, the guess will be to start with files created on or after May 32)! INCBUP does several other checks, such as ensuring that there is enough room on the disk for the backed-up files and verifying the files copied to the backup volume. All target volumes are check- ed for initialization before they are used. A printed directory of the backed-up files is also made. As the procedure is cur- rently configured, the printer ENDPAG function is turned off while INCBUP is running. It is turned on at the end, and a form feed is done. This is done with a UCL+ symbol. To do so under TSX+ requires the definition of the symbol EJECT, which is in- cluded in INDFIL.UCJ. Backups of several devices can be done in one INCBUP "session". When INCBUP finishes, it rewrites the INCBUP.DAT data file to update the date of the last backup. Therefore, the automatic determination of the date to start the incremental backup will only work once per session! It is therefore recommended that all backups be done at one time. You have the option to use the same parameters for subsequent backups. File cataloging is done with the DSKLIB program. In order to use it the DSKLIB library file INCBUP.DLB must first be cre- ated on the device specified in the INCBUP.IND parameters. The files DSKLIB.SAV, DLBCOM.SAV and LIBCAT.DLB must be on the system disk before using INCBUP. The DSKLIB package includes a compre- hensive user's manual, which should be reviewed before using the package. Note... The program DLBCOM is used to pass a command line to DSKLIB (circa RT version 4!). The format of the DLBCOM input command line is somewhat wierd, and shouldn't be tampered with in INCBUP.IND unless you know what you are doing. IND Control Files Page 6 PARSE, INDFIL ______ ______ PARSE is an IND subroutine file which may be used to return complete information on a filespec. In the calling IND proce- dure, you can provide a default device and extension, to be used if the filespec entry does not include them. PARSE can determine the physical name of the device supplied (thus, if the filespec is DK:..., PARSE returns the actual device assigned to DK). PARSE accepts two arguments. The first is the filespec to be parsed and the second is a flag specifying whether the physi- cal name of the device is to be determined. PARSE returns three parameters: $DEV (the device - either physical or logical name), $FILNM (the filename and extension) and $FILSP (the entire file- spec). INDFIL is a subroutine which reports the device that the IND control file is running on. This is of use if you are writing a installation procedure. IND Control Files Page 7 INDFIL.UCJ UCL+ Symbol Definitions for IND Control Files CUR ==type SY:CURDK.TMP DOWN ==r IND \ SY:DOWN.IND ^1 ^2 ^3 EJECT ==_disp/noform0/out:^[LP]: "<014> HOME ==r IND \ SY:UP.IND HOME NEWLD ==r IND \ SY:NEWLD.IND ^1 ^2 ^3 ^4 ^5 OVER ==r IND \ SY:UP.IND a b \ r IND \ SY:DOWN.IND ^1 ^2 ^3 UP ==r IND \ SY:UP.IND TSX+ Note... If you normally set your print spooler to ENDPAG=1, replace the "<014> in the definition of EJECT with "<040>.