October 15, 1986 IND Control Files DOWN, UP, HOME - For management of subdevices. _____ ___ ____ NEWLD - For creating new subdevice files. _____ INCBUP - For doing incremental backups of data. ______ Written by: R. W. Barnard Sandia National Laboratories Minicomputer Software Division 7523 Albuquerque, NM 87185 DOWN, UP, HOME ____ __ ____ The IND control files DOWN, UP, HOME, and OVER can be used to conveniently move among subdevices. Using these facilities, you can have the equivalent of subdirectories 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. DOWN supports two levels of subde- vices (i.e., a subdevice within a subdevice). If the device is not specified, DOWN will search through a predetermined list of devices to look for the file. DOWN also includes a comprehensive filespec parser. The current file mounted by DOWN and the logi- cal device name are stored in the file SY:CURDK.TMP. The file DOWN takes as arguments the file you want to go down to and an optional logical name. If no file extension is given, .DSK will be assumed. If no device is specified, it will search a prede- termined list of devices looking for the file. DOWN should be edited to customize it for your installation. UP moves back up one subdevice and reassigns the logical device name given in DOWN to that subdevice. If you currently are down two levels (in a subdevice inside another subdevice), UP will return you to the outer subdevice. HOME returns you from whatever depth of subdevice you are nested to SY as your default device. If a logical name was given with DOWN, this is also deassigned. Both UP and HOME report the current location and logical device name in CURDK. The comments at the beginning of each file provide more information about the meanings of the parameters and the oper- ation of the files. IND Control Files Page 2 Because of a limitation of IND (which has been SPR'ed) it is not possible to relate a file to a logical device assignment (or vice versa) from within an IND file. Consequently, these IND files use LD6 for the first level of subdevice, and LD7 for the next subdevice. Maximum nesting is currently two. Furthermore, when you go DOWN, you are told exactly which file is now your default (e.g., DU0:FORTRA.DSK), but when you come UP, IND cannot tell which device you are currently on. It therefore can only report the name of the file, but not the device. These files can be used very effectively with a User Command Linkage (UCL). Thus, define DOWN == R IND\SY:DOWN ^1 ^2 (assuming you are using UCL+... syntax is slightly different for the DEC UCL). To use, you can then just type DO[WN] FILESPEC LOGICAL_NAME. UCL can be used to define the symbol OVER, to go from one subdevice to another. The symbol definition is: OVER == R IND\SY:UP XYZ\R IND\SY:DOWN ^1 ^2 The "XYZ" parameter for the file UP suppresses the report of the your current whereabouts on the way over to the new subdevice. The UCL symbol CUR (for current location) can be defined to type the file CURDK.TMP. 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. 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, so if an incomplete 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 par- ameter. When file sizes are specified by using a disk type, they are identical with files which would be created by the KMON com- mand 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. Five disk types are currently defined: DX (494 blocks, 1 directory segment as default), DU (800 blocks, 4 segments), DY (988 blocks, 4 segments), FW (2432 blocks, 7 segments) and DL (10210 blocks, 16 segments). The types and sizes can be easily changed. A logical name can be supplied; if not, the subdevice is as- signed DK. You can define a UCL symbol to invoke NEWLD, such as NEWLD == R IND\SY:NEWLD ^1 ^2 ^3 ^4 ^5 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 retrieval. Backups can be done from any size or type of disk (including LD's) to any other disk. 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 parameters of INCBUP are source volume, backup volume, and date of backup. The disks 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 Library #11-743). Each backup volume is given a serial number used by DSKLIB for retrieval purposes. The date of the last backup and the next DSKLIB serial number to be used is stored in a file. Defaults are provided for the backup data file, the LD number to be used when the backup volume is to be a subdevice file, the backup device, and for many other parameters. These can all be changed by editing the INCBUP file. As INCBUP executes, you are prompted for inputs. You are first prompted for the source volume; if you wish to back up the contents of a subdevice file, specify the device as a LD unit. (The subdevice does not need to already be mounted). If you have specified a LD, you will be prompted for the actual subdevice file name. 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. If the backup (target) volume is an LD, the device on which the subdevice file will reside is requested. The incremental backup is done by doing a DIRECTORY/SINCE:xxxxxx and then copying only the files identified by that command. Files whose exten- sions are .BAK and .DSK are not included. 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 insuring that there is enough room on the disk for the backed-up files and ver- ifying the files copied to the backup volume. A printed directory of the backed-up files is also made. IND Control Files Page 5 Backups of several devices can be done in one INCBUP "ses- sion". When INCBUP finishes, it rewrites the INCBUP.DAT data file to update the date of the last backup. Therefore, the auto- matic 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. File cataloging is done with the DSKLIB program. In order to use it the DSKLIB library file SY:INCBUP.DLB must be created first. The files DSKLIB.SAV, DLBCOM.SAV and INCBUP.DLB must be on the system disk before using INCBUP. The DSKLIB package in- cludes a comprehensive 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 unless you know what you are doing. IND Control Files Page 6 6atching IND When both command files and control files have the extension .COM, it can be sometimes confusing which is which. Furthermore, under TSX+, a control file will automatically be executed as a command file before UCL is reached. This often has unfortunate consequences. A solution is to patch IND.SAV so that the default file type is .IND. To do this, use SIPP as follows: R SIPP *SY:IND.SAV/A Base? Offset? ;S Search for? ;RCOM Start? End? 4000 Found at 3436 Found at 3440 ... Offset? 3436 Base Offset Old New 000000 3436 012445 ;RIND 000000 3440 012445 ^Y There are four consecutive instances of COM in the file IND, but it appears that only the first one needs to be changed. Please note that this patch is for research purposes only, and is totally non-guaranteed.