skip book previous and next navigation links
go up to top of book: HP OpenVMS System Manager's Manual, Volume 1:... HP OpenVMS System Manager's Manual, Volume 1:...
go to beginning of chapter: Using BACKUP Using BACKUP
go to previous page: Understanding BACKUP Tape Label Processing Understanding BACKUP Tape Label Processing
go to next page: Restoring Files and DirectoriesRestoring Files and Directories
end of book navigation links

Backing Up Files and Directories  



This section explains copying files, backing up files and directories, comparing files, and creating and listing BACKUP journal files.
NoteWhen you use the Backup utility with files, BACKUP processes relative version -0 as if it were 0, saving the most recent version instead of the earliest version of the file for processing.

Copying Files to Other Files  

You can copy files using BACKUP. The copy function of the BACKUP command differs from the DCL command COPY because it preserves certain file information such as the version number, creation dates, revision dates, and protection codes (although, by default, the owner UIC of the copies is the UIC of the current process). Also, unlike the DCL command COPY, you can use BACKUP to copy entire directory trees, maintaining the directory structure.

How to Perform This Task

To make identical disk-to-disk copies of files, use the following format:BACKUP input-specifier output-specifier

Examples

  1. The following command copies the file EMPLOYEES.DAT in the current directory to the directory [BATES.TEST]:
    $ BACKUP EMPLOYEES.DAT USER1:[BATES.TEST]EMPLOYEES.DAT
  2. You can also create copies of entire directory trees. For example:
    $ BACKUP USER1:[BATES...] USER2:[BATES...]
    This command re-creates the directory structure of user BATES on the disk named USER2:
  3. The following command copies all files in the directory tree [LYKINS...] to the directory tree [OWLCR...] on the same disk:
    $ BACKUP [LYKINS...]*.*;* [OWLCR...]*.*;*

NoteDisk-to-disk copy operations initiated using the /VERIFY qualifier might attempt to verify files that are not copied. For example, if an error prevents you from successfully copying a file from one disk to another location and you specified the /VERIFY qualifier for that operation, the system displays two error messages: one indicates that the file was not copied, and the other indicates that the file was not verified.

Backing Up Files and Directories to a Save Set  

One of the most common BACKUP operations is to save files to a save set. There are several types of save sets. For more information about save sets, see Understanding Save Sets.

How to Perform This Task

To back up files or directories, use the BACKUP command in the following format:BACKUP input-specifier output-specifier [/SAVE_SET] [/LABEL=label]

The input-specifier specifies the file you want to back up, and the output-specifier specifies the device and save-set name.

When you save data to disk, use the output save-set qualifier /SAVE_SET. If you do not specify /SAVE_SET, BACKUP copies files in standard file format rather than creating a BACKUP save set. When you save data to tape, you do not need to specify /SAVE_SET; BACKUP treats all magnetic tape files as save sets. Use the /LABEL qualifier to specify the label of the tape you are using.

Examples

  1. The following commands back up the file EMPLOYEES.DAT to a save set:
    $ ALLOCATE MUA0: TAPE1 [1] 
    %DCL-I-ALLOC, MUA0: allocated
    $ INITIALIZE TAPE1 DLY101 [2] 
    $ BACKUP/LOG EMPLOYEES.DAT MUA0:EMPL_MAY91.BCK/LABEL=DLY101 [3] 
    %MOUNT-I-MOUNTED, BACKUP mounted on _MUA0:
    BACKUP-S-COPIED, copied DUA0:[SCHULT]EMPLOYEES.DAT;32
    $    
    In this example, the individual commands performs the following actions:

    1. Allocate the tape drive MUA0: and assign it the logical name TAPE1.
    2. Initialize the tape in the drive and assign it the label DLY101.
    3. Save the file EMPLOYEES.DAT to a save set on the tape in MUA0. The /LOG qualifier causes BACKUP to display the file specification of the file that BACKUP copies. The /LABEL qualifier indicates the volume label that you assigned with the INITIALIZE command.
  2. To create a magnetic-tape save set named NOV13SAVE.BCK that contains all files and subdirectories of a directory tree named [LYKINS...], enter the following command:
    $ BACKUP [LYKINS...] TAPE:NOV13SAVE.BCK/LABEL=NOV13
  3. You can also specify a list of files that you want to back up:
    $ BACKUP
    _From: DUA0:[MGR]EMPLOYEES.DAT,USER1:[RECORDS]DOOHAN.DAT,EVANS.DAT
    _To: MUA1:MONTHLY_AUG.BCK/LABEL=TAPE1
  4. If you are backing up large amounts of data, you can also specify more than one output device:
    $ BACKUP
    _From: DUA0:[000000]*.*
    _To: MTA1:BACKUP.BCK,MTA2:
    In this example, if BACKUP uses all of the space on the tape in MTA1:, it continues writing the save set on the tape in MTA2: (assuming MTA2: contains a tape that has never been initialized or one that has been initialized with the label BACK02).
  5. As shown in the following example, you can create a Files-11 save set that consists of a single file; DUA1: is already mounted:
    $ BACKUP STRATCOL1.DAT DUA1:STRATDAT1.BCK/SAVE_SET 
  6. To create a network save set, add the node, user name, and password to the output specifier in the following format:remote_nodename"username password"::device_name:[directory]For example:
    $ BACKUP
    From: STRATCOL1.DAT  
    To: NIMBL"ROGERS SANFRANCISCO"::WORK1:[ROGERS]STRATDAT1.BCK/SAVE_SET 
  7. To create a sequential-disk save set on DUA0: named NOV12SAVE.BCK that consists of all files in the current default directory, enter the following commands:
    $ MOUNT/FOREIGN DUA0:                                         
    $ BACKUP [] DUA0:NOV12SAVE.BCK/SAVE_SET 
  8. The following example backs up the directory tree [REPORTS...] to a save set:
    $ BACKUP [REPORTS...] MIA11:REPORT.BCK/REWIND/IGNORE=LABEL_PROCESSING
    The /REWIND qualifier in this command line rewinds the tape and initializes it. The /IGNORE=LABEL_PROCESSING qualifier causes BACKUP to ignore any existing label information on the tape. Because the command does not include the /LABEL qualifier, BACKUP uses the first six characters of the save-set name (REPORT) as the label.
  9. You can also back up a directory to a disk that is mounted in the Files-11 format. For example:
    $ MOUNT DUA1: PAYROLL
    %MOUNT-I-MOUNTED, PAYROLL mounted on _DUA1:
    $ MOUNT DUA21: DISK21
    %MOUNT-I-MOUNTED, DISK21 mounted on _DUA21:
    $ BACKUP
    From: DUA1:[PAYROLL]
    To: DUA21:[PAYROLL_BACKUPS]PAY22MAY2000.SAV/SAVE_SET
    If the contents of the [PAYROLL] directory exceed the capacity of the disk DUA21:, the backup operation fails.
  10. If you are backing up more data than the output volume can contain, mount the output volume using the /FOREIGN qualifier and create a sequential disk save set. For example:
    $ MOUNT DUA1: PAYROLL
    %MOUNT-I-MOUNTED, PAYROLL mounted on _DUA1:
    $ MOUNT/FOREIGN DJA21:
    %MOUNT-I-MOUNTED, WEEKLY mounted on _DJA21:
    $ BACKUP
    From: DUA1:[PAYROLL]
    To: DJA21:[PAYROLL_BACKUPS]PAY22MAY2000.SAV/SAVE_SET
    In this example, if the contents of the [PAYROLL] directory exceed the capacity of the disk DJA21:, BACKUP prompts you to remove the volume in the drive and insert another one. For more information about Files-11 and sequential disk save sets, see Understanding Save Sets.

NotePrior to OpenVMS Version 7.2, 32 levels of directories were supported. Beginning with OpenVMS Version 7.2 on VAX and Alpha systems, the number of levels of directories can be as high as RMS allows; for OpenVMS Version 7.2 and later, that number is 255 levels.

Comparing Files  

A BACKUP compare operation compares a save set with disk files or compares disk files with other disk files. Perform a compare operation to check the integrity of a file or volume after a copy, save, or restore operation. For example, you can use the compare operation to compare a save set with original files or to compare files or volumes copied using BACKUP with original files.


NoteBecause BACKUP processes files by blocks, comparing files not produced by BACKUP is likely to cause mismatch errors in files that are apparently identical.

How to Perform This Task

The two ways to perform a compare operation are:

Examples

  1. The following example compares a save set on tape with files on disk. The command directs BACKUP to compare the contents of the save set 2MAR1555.BCK with the directory [LYKINS].
    $ BACKUP/COMPARE MTA0:2MAR1555.BCK [LYKINS]
  2. The following example compares files on disk; note the inconsistency in block 16 between UPLIFT.EXE;4 and UPLIFT.EXE;3:
    $ BACKUP/COMPARE UPLIFT.EXE;3 UPLIFT.EXE;4
    %BACKUP-E-VERIFYERR, verification error for block 16 of
     WRKD$:[LYKINS]UPLIFT.EXE;4
  3. To compare two entire Files-11 volumes, use an image compare operation, as follows:
    $ BACKUP/IMAGE/COMPARE DBA1: DBA2:
  4. To compare a physical save set with a Files-11 volume, use a physical compare operation, as follows. All disks in a physical compare operation must be mounted as foreign volumes.
    $ MOUNT/FOREIGN DBA2: 
    $ BACKUP/PHYSICAL/COMPARE MIA0:PHYSBACK.BCK DBA2:
  5. The following example combines a compare operation with a copy operation:
    $ BACKUP/VERIFY/LOG FRED.DAT [FRIENDS]OLDFRED.DAT
    %BACKUP-S-CREATED, created DISK$:[FRIENDS]OLDFRED.DAT;3
    %BACKUP-S-COMPARED, compared DISK$:[FRIENDS]OLDFRED.DAT;3

Creating and Listing BACKUP Journal Files  

To keep a record of BACKUP operations, create a journal file. A BACKUP journal file contains records of BACKUP save operations and the file specifications of the files saved during each operation.

How to Perform This Task

To create a journal file, use the command qualifier /JOURNAL=[file-spec] in a BACKUP save operation.

To list the contents of a BACKUP journal file, enter a command in the following format:BACKUP/LIST[=file-spec]/JOURNAL[=file-spec]

You cannot specify an input or output specifier with a BACKUP/LIST/JOURNAL command. If you omit the file specification from the command qualifier /LIST, BACKUP directs the output to your terminal; if you omit the file specification from the command qualifier /JOURNAL, the journal file receives the default BACKUP journal file name (SYS$DISK:[]BACKUP.BJL).

For more information about creating and listing BACKUP journal files, refer to the description of the /JOURNAL qualifier in the HP OpenVMS System Management Utilities Reference Manual.

Example

This example shows how to create a BACKUP journal file and list the contents of the BACKUP journal file:

$ BACKUP/JOURNAL/LOG/IMAGE  DRA2: MIA0:3OCT.FUL
%BACKUP-S-COPIED, copied DRA2:[COLLINS]ALPHA.DAT;4
%BACKUP-S-COPIED, copied DRA2:[COLLINS]EDTINI.EDT;5
.
.
.
%BACKUP-I-RESUME, resuming operation on volume 2
%BACKUP-I-READYWRITE, mount volume 2 on _MIA0: for writing
Press return when ready: [Return] 
%BACKUP-S-COPIED, copied DRA2:[LANE]MAIL.MAI;1
%BACKUP-S-COPIED, copied DRA2:[LANE]MEMO.RNO;5
.
.
.
$ BACKUP/JOURNAL/LIST
Listing of BACKUP journal
Journal file _DB2:[SYSMGR]BACKUP.BJL;1 on 3-OCT-2000 00:40:56.36
Save set 3OCT.FUL created on 3-OCT-2000 00:40:56.36
Volume number 1, volume label 3OCT01

         [COLLINS]ALPHA.DAT;4
         [COLLINS]EDTINI.EDT;5
         [COLLINS]LOGIN.COM;46
         [COLLINS]LOGIN.COM;45
         [COLLINS]MAIL.MAI;1
         [COLLINS]MAR.DIR;1
         [COLLINS.MAR]GETJPI.EXE;9
         [COLLINS.MAR]GETJPI.LIS;14
                   .
                   .
         [LANE]LES.MAI;1
                   .
                   .
Save set 3OCT.FUL created on 3-OCT-2000 00:40:56.36
Volume number 2, volume label 3OCT02

          [LANE]MAIL.MAI;1
          [LANE]MEMO.RNO;5
          [LANE]MEMO.RNO;4
                   .
                   .
          [WALTERS.VI]KD.RNO;52

End of BACKUP journal

go to previous page: Understanding BACKUP Tape Label Processing Understanding BACKUP Tape Label Processing
go to next page: Restoring Files and DirectoriesRestoring Files and Directories