JGD-48 MEMO: TO: VAX Users FROM: James G. Downward SUBJECT: JNLBACKUP -- File Backup Procedure DATE: 27-OCT-1982 1.0 INTRODUCTION It is very important for users doing program development work to routinely backup their files so that in the event of a disk disaster (crash, droped disk, etc.) or a user error ("I typed DEL instead of DIR") critical files can be recovered (1). On the VAX, the MSA0: tape drive is used for backing up files to tape. While there are a number of ways of placing files on tape, the most reliable and fastest uses the BACKUP utility. BACKUP is a very sophisticated utility in that it stores sufficient information on the tape copy it makes, to recover from bad spots on the tape or an accidental "crinkling" of part of the tape. Files stored to tape with the COPY command are much more prone to getting lost in the event of a tape error. One disadvantage of using BACKUP is that there are so many options for using it that the infrequent user probably would have trouble using it in a manner which would insure future recovery of backed up files. To simplify the process, the VMS procedure JNLBACKUP exists which will 1. Back up all files or just some files on a users directory, subdirectory, or all directories. 2. Back up all files or just the files created since a certain date. 3. Insure that the files stored to tape are stored with a unique container file name. 4. Allow multiple backups to be done on the same tape. 5. Keep a running log of each backup done specifying which tape was used, the BACKUP container file name used, the date range backed up, the directory(ies) selected for backup and the files selected for backup. Additionally it logs the number of tape ------------------------------------------- 1. The system disk (DRA0:) is generally backed up weekly or biweekly but this is not guaranteed. Since the sole purpose of this backup is to maintain the integrity of system files, this backup is not intended to supplant or provide a guaranteed recovery for files on DRA0: lost by a user. DRA1: is only backed up when system files change. Backup of files either more frequently than the system disk, or on a disk other than the system disk is the sole responsibility of the user. JGD-48 Page 2 errors which occurred during the backup. 6. Prints the log file so it can be filed (in case disk disaster wipes out file). 7. Keeps a "journal log" file of all files backed up and their container file name. This "journal log" can be used by backup to list all files backed up to tape without having to mount the tape and list its contents. In this way a user can find what tape and what backup set(s) a file or files are on without having to search one or more BACKUP tapes. 8. The JNLBACKUP procedure verifies that the files copied to tape can be read from the tape and agree identically with the version on disk. 2.0 USING JNLBACKUP JNLBACKUP is very easy to use. You must have a tape and know how to thread the tape on the MSA0: tape drive. It may be run equally well from a hardcopy or video terminal since a log file is created which records what your input was. To use the JNLBACKUP facility, type CMD JNLBACKUP or @SYS$SYSROOT:[SYSMGR.CMDFIL]JNLBACKUP The dialog with JNLBACKUP now begins: 1. JNLBACKUP asks "Which disk do you wish to backup: ". You should input the name of the disk on which the files to be backed up reside. JNLBACKUP will print an error message if either 1. The device is not a disk. 2. The device is not mounted. 3. The disk does not exist. After printing a warning message, JNLBACKUP will prompt again for the disk to backup. Disk names should be of the form DRA0:. The ":" is optional. Additionally, one may specify the system logical names SYS$SYSROOT and SYS$SYSDEVICE. At present the only disks accepted are DRA0:, DRA1: and DMA1:. 2. JNLBACKUP now prompts "What is the directory name: ". Enter the directory string you wish to back up. For example, if [DOWNWARD] was entered in response to that prompt, just the files on the root directory [DOWNWARD] would be backed up. Likewise, if [DOWNWARD.RUNOFF] was entered, only the files on JGD-48 Page 3 the subdirectory [DOWNWARD.RUNOFF] would be backed up. To back up all subdirectories the standard VMS directory specifier [DOWNWARD...] would be used. JNLBACKUP does not verify that a valid directory string was entered. However, if the directory is not found, the BACKUP utility will print an error message. 3. Next JNLBACKUP asks for the tape name. Every tape must have a 1-6 character long name. If this is the first time JNLBACKUP is used the name will written to the tape at this time. If you are adding files to an existing tape, the files will be added only if the name is correctly entered. The name for a tape should be afixed to the reel and tape-seal belt. The tape name is entered in the JNLBACKUP.LOG file so that users can know which tapes contain which backups. 4. Next JNLBACKUP asks for the tape number. If the tape does not have a number afixed to it, select one and paste it both on the reel and on the tape-seal belt. This number is loged to the JNLBACKUP.LOG file so that if you have several tapes with the same name, you can tell which tape is the one with the files you want. The number can be either just a number 1-99 or may be prefixed with up to a 3 character ID string. Hence, numbers 1, 2, X1, and JGD5 are all legal. 5. Next JNLBACKUP asks if you wish to "Initialize a new tape or append to an existing backup set (I/A): ". Only I or A are allowed answers. All files backed up are placed in a container file. A given tape can hold one or more container files depending on the size of the tape and the number of files backed up each time into the container files. If the tape is initialized all previous files backed up to that tape are lost. If the append option is chosen, files backed up are placed in a new container file after the last container file on the tape. Appending can not be done without limit. When the tape runs out and more files still need to be backed up, the tape will rewind and the system will prompt to mount another tape. It is important that if you only have one tape, that you not let this happen. So be sure you have sufficient space on the tape prior to selecting an append operation. If you are only backing up a few hundred blocks of files at a time, many append operations can be done on a single tape. A 2400 ft reel of tape can backup up about 50000 blocks of files. 6. If you select the "Initialize" option, JNLBACKUP will ask you if you are sure and warn you that any existing files backed up to the tape will be wiped out by initializing. 7. By default JNLBACKUP will backup files created after a certain date. It keeps track of the last time you backed up files. It now will prompt saying "Backup files starting from ( -> dd-MMM-YYYY): ". If you type carriage return (), files created since the last time you backed up will be backed up. This is fine if you always enter the same directory specification and select string every time you do a backup. However, if sometimes you backup *.FOR files and othertimes you JGD-48 Page 4 backup *.COM files and the disk being backed up varies, you must remember that the default time displayed is the date you last used JNLBACKUP, not the last date you backed up the files with the selected disk, directory, and file selection string. The date must be entered in standard VMS format (dd-MMM-YYYY). If in doubt as to a date to enter, enter 01-JAN-1976 or the earliest creation date in your directory (DIR *.*/DA). 8. Finally, JNLBACKUP will prompt for the "File Selection String". If you type RETURN, all files (*.*;*) will be backed up on the selected directory(ies). However, you can enter a simple file string such as *.FOR, SHELLDATA.DIC, SHELL.*, etc. 9. Now all user inputs to JNLBACKUP are done and JNLBACKUP will ask you to "Place a mag-tape on MSA0:" and "Type RETURN when ready". 10. When you are ready, type return. JNLBACKUP will now run, back the files up to tape, create JNLBACKUP.LOG and JNLBACKUP.BJL on SYS$LOGIN, print JNLBACKUP.LOG, tell you to place a date sticker on the reel, and rewind the tape. The tape will not be unloaded, so multiple backups can be done conveniently. When JNLBACKUP finishes, physically dismount the tape, afix a date sticker and store it in a safe place. The JNLBACKUP.LOG printout should be removed from the printer and filed. Only the most recent copies of the printout need be saved. Be careful not to delete JNLBACKUP.LOG or JNLBACKUP.BJL if you are ever going to need them for finding files permanently backed up to tape. If you plan to back up files to tape and then delete the files on disk to recover disk space, it is very, very important to never initialize that tape. If the only copies of a backed up file are on a tape and that tape gets initialized, the only copies of the file are deleted and can never be recovered. There is no way the command procedure can protect you from wiping yourself out due to carelessness. If you are planning to back up files to tape and delete disk sources, good practice is to back up the files to two different tapes before deleting the disk files. Then remove the write protect rings and place one tape copy in a safe. Use seperate tapes for archival storage and for routine backups. Archival tapes should only be initialized once, when they are first made.