BACKUP.HLP RETURN.HLP SPECIAL BACKUP SYSTEM INSTRUCTION AND DISCRIPTION ******************************************************************************* WRITTEN BY: RONALD HOEKSEMA PERSONNEL DEPARTMENT, THE FIRST NATIONAL BANK OF CHICAGO 1 FIRST NATIONAL PLAZA, 22ND FLOOR CHICAGO, ILLINOIS 60670 DATE: SEPTEMBER 1, 1982 ******************************************************************************* Neither First Chicago Corporation, the First National Bank of Chicago, nor any of its employees makes any warranty, either expressed or implied, assumes any legal liability, nor any responsibility for the accuracy, completeness or usefulness of any information, product or process disclosed. Neither does First Chicago Corporation, the First National Bank of Chicago, nor any of its employees represent that use of this material would not infringe privately owned rights. ******************************************************************************* INTRODUCTION This is a brief discription of the special backup system that is in use currently on our computer. Additional technical information is contained in file BACKUP.DOC. This writeup contains a discription of the systems concept and a step by step discription of what takes place during execution and how to recover the files. CONCEPT When doing a backup using this system only 2 files will be written to the tape. The first file that is written on the tape is the directory of all the disk files that are to be backed up and written in the second tape file. The directory file contains the name, size, location, and creation date for each disk file backed up. The second tape file contains the actual files that are backed up. These files are packed one right after the other. Having a blocking factor of up to 20 (10240 bytes per block) reduces the total number of tape blocks written as well as the total number of inner block gaps. This method allows us to put a very large amount of data on the tape. FILES IN THE SYSTEM This backup system uses C programs, command files, data files, and the system editor. The following list shows the relationship of all the files to each other. They are listed in the order that they are used. ** DUMPING FILES TO THE TAPE ** command file : BACKUP.COM (today's_date) files run created data files input data files BCKUP.C TBACK .BTF TBACK0.LST,TBACK1.LST,TBACK2.LST, TBACK3.LST,TBACK4.LST BCKTPE.C (write the tape) TBACK.BTF BCKDIR.C BACKUP.LST (reads tape) BACKUP.HLP RETURN.HLP -- page 2 -- ** WHAT FILES ARE TO BE RECOVERED ** use the system editor : input to editor : BACKUP.LST (directory of all files on tape) create in editor: BACKUP.GET (directory of only those files) (that are to be recovered ) ** RECOVERING FILES FROM THE TAPE ** command file : RETURN.COM (today's_date) files used created files input data files RETRN.C RETRN.COM BACKUP.GET RETRN.COM (allocates disk files) RETTPE.C (restores disk files) BACKUP.GET USING THE BACKUP SYSTEM Entering the command "BACKUP.COM today's_date" is all that is needed to dump the disk files to magnetic tape. BACKUP.COM first creates a file for each platter that is to be backuped. These files contain the platter directories, and are named DK:TBACK0.LST, DK:TBACK1.LST, DK:TBACK2.LST, DK:TBACK3.LST, and DK:TBACK4.LST. In addition, three C programs are also run. They will be discribed in the order that they are run. Today's_date must be entered in the form (DD-Mmm-YY). BCKUP.C This is a C program that combines the directory files DK:TBACK0.LST, DK:TBACK1.LST, etc. into one file which is called DK:TBACK.BTF. All files with a size of zero, with no date, and with certain names are not added to to this file. Also since the physical size for the tape limits us to about 105,000 disk blocks, once the cumulative size for all the files reaches 100,000 blocks no more files will be added. For each file, a cumulative size count is calulated. This cumlulative size is effectively the location (in terms of 512 bytes) at which the respective file is to be located in the second file on the backup tape. For each file, exactly 32 characters are written to file TBACK.BTF. They are; 14 character name, 5 digit size, 6 digit location, and 7 character creation date. The name, size, and location variables are all left justified in their respective fields, and the embedded "-" in the creation date are removed. To keep this program as general as possible, this program prompts for the names of all the directory files used. The output file (file TBACK.BTF) name is asked of first. Since more than one input file can be used, this program will repeatedly ask for the next input file name and the device from which it was generated until the keyword 'DONE' is entered. This terminates the program. BCKTPE.C This is the C program that does the actual writting to the backup tape. The program first prompts for the name of its input file (TBACK.BTF). This keeps this program generalized also. TBACK.BTF is first written to the tape. A tape mark is written next. TBACK.BTF is the directory for what is written in the second tape file. The second and last tape file written contains the actual contents of all the disk files listed in the tape directory. They are all packed in this file back-to-back at a blocking factor of up to 20. BACKUP.HLP RETURN.HPL -- page 3 -- BCKDIR.C This C program reads the directory as written on the tape and then prints it out to a terminal. The file's name, size, tape location, and creation date is printed. The tape location consists of the actual block number and sub-block number of the starting point for each file. Both values begin at '0'. If the blocking factor is 20, then there are 20 sub-blocks in a tape block, each consisting of 512 bytes (1 disk block). For example; the very first file backed up starts at tape location 0-0 (block=0, sub-block=0). A file that starts at the 10th sub-block of the 210th tape block is located at 209-09. The file size is in number of disk blocks (512 bytes or 1 sub-block). File BACKUP.LST is created at this time. It contains the same information that is printed on the directory, but is saved so that it can be used in the file recovery process. The date that was entered as an argument in the command file call is used in BCKDIR.C . The date is part of the printout. This program can be run all by itself. If this is the case, the program will prompt the user for "today's_date" and will ask if a printout is desired. If a "n" or a "N" is entered BCKDIR.C will not print out the directory. The creation of file BACKUP.LST will be the only thing done. WHAT FILES ARE TO BE RECOVERED File BACKUP.LST contains the backup tape directory that must be used to recover any file saved on the tape. If needed, the directory program BCKDIR.C can be run so as to create BACKUP.LST. BCKDIR.C can be run by itself by typing "R BCKDIR" while in the monitor mode. BACKUP.LST should be read into the system editor. Once this is done, it can be reduced, by deleting lines, so as to contain the directory information on only the files that need to be restored. This reduced directory must then be saved as "DP0:BACKUP.GET". ONLY THOSE FILES LISTED IN THIS FILE WILL BE RESTORED. RECOVERING THE DATA FILES Once the data file BACKUP.GET has been created, the system is ready to restore files. To restore the data files listed in BACKUP.GET one needs only to enter the command "RETURN.COM todays_date". "Today's_date" in the form DD-Mmm-YY must be entered as an argument for this command file. This command file executes 2 C programs and 1 command file. They are discribed in the order that they are run. RETRN.C C program which makes sure the the file which is to be restored is no longer on the system. If the file to be restored is still on the system, it will be purged. RETRN.C prints a message for every file that is to be restored. RETRN.C also creates the command file RETRN.COM which is run right after RETRN.C . RETRN.COM This command file executes 2 commands for each file to be restored. First, the system date is changed to that of the creation date as found on BACKUP.GET. Second, the file is created and the appropriate amount of space is allocated for it on the disk. Doing this for each file that is to be restored, allows each file to keep its original creation date. The very last command executed returns the system to "today's_date". Caution must be taken during this part of the recovery process. Since the system's date is constantly changing, files should not be created by other system users. BACKUP.HLP RETURN.HLP --page 4 -- RETTPE.C This final program reads the backup tape according to the directory found in BACKUP.GET and writes the data found on the tape to the files that were allocated in the previous step. When completed, the files should be completely restored to the disk in all regards except for and protect status. The protect status "P" was removed. If a file was protected before it will not be protected after. SYSTEM ROUTINES AND FILES The following is a list of the files and routines used: BACKUP.COM BCKUP.C BCKTPE.C BCKDIR.C RETURN.COM RETRN.C RETTPE.C BACKUP.LST BACKUP.GET TBACK*.LST TBACK.BTF BACKUP.LST and BACKUP.GET are the only data files that are hard coded into the programs. The other directory files (TBACK*.LST & TBACK.BTF) are prompted for in all the programs where they are used. Any naming convention could therefore be used. Files TBACK*.LST must however be in a very specific form. We generate these files by the following directory command: DIR DPx: /COLUMNS:1 / OUTPUT:TBACKx.LST It results in a directoy that has the following form: columns 1-10 .. file name columns 11-15 .. file size columns 18-26 .. creation date and has exactly 29 characters including the carriage return and line feed charactters. COMMAND FILE EXAMPLES Command file as we use it. Can be modified or programs can be run seperately. BACKUP.HLP RETURN.HLP --page 5 -- File : BACKUP.COM ^)^> dir /exclude dp0:(si*.fsa,ei*.fsa) /columns:1 /output:tback0.lst dir /exclude dp1:(si*.fsa,ei*.fsa) /columns:1 /output:tback1.lst dir /exclude dp2:(si*.fsa,ei*.fsa) /columns:1 /output:tback2.lst dir /exclude dp3:(si*.fsa,ei*.fsa) /columns:1 /output:tback3.lst dir /exclude dp4:(si*.fsa,ei*.fsa) /columns:1 /output:tback4.lst r bckup TBACK.BTF TBACK0.LST DP0: TBACK1.LST DP1: TBACK2.LST DP2: TBACK3.LST DP3: TBACK4.LST DP4: DONE r bcktpe TBACK.BTF r bckdir ^1 y delete/noq tback*.* File : RETURN.COM ^>^) time r retrn ^1 retrn1.com r rettpe time