Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS System Manager's Manual


Previous Contents Index

  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.
  • 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
    

  • 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
    

  • 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).

  • 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 
    

  • 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 
    

  • 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 
    

  • 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.

  • 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]PAY22MAY1998.SAV/SAVE_SET
    

    If the contents of the [PAYROLL] directory exceed the capacity of the disk DUA21:, the backup operation fails.

  • 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]PAY22MAY1998.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 Section 10.5.

    Note

    Prior 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, that number is 255 levels.

    10.13.3 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.

    Note

    Because 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
      

    10.13.4 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 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-1998 00:40:56.36
    Save set 3OCT.FUL created on 3-OCT-1998 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-1998 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
    

    10.14 Restoring Files and Directories

    A BACKUP restore operation takes a save set and restores it to its original condition. Often a restore operation is the result of a crisis (you have deleted an important file or a disk has become corrupted, for example). When you restore files, BACKUP places the contents of the save set in the location that you specify.

    To restore an entire disk, see Section 10.16.

    How to Perform This Task

    To restore files, use the BACKUP command in the following format:

    BACKUP  save-set-specifier [/SAVE_SET] /SELECT=[dir...]  output-specifier:[dir...] 
    

    Use the /SAVE_SET qualifier if the save set is on a disk or diskette. The /SELECT qualifier lets you specify the exact file you want to restore.

    If your save set is stored on more than one magnetic tape or sequential disk volume, it is possible to begin restore and compare operations with any volume of the save set. However, if you are restoring a save set with the command qualifier /IMAGE, processing must begin with the first volume. (An image restore operation restores all files to a volume or volume set.) If you attempt an image restore or compare operation and specify a tape that is not the first volume of the save set, you receive the following message:


    %BACKUP-W-NOT1STVOL, tape 'name' is not the start of a save set
    

    You can use the command qualifier /LOG to monitor the files as they are restored. To restore only a small number of files from a large save set, press Ctrl/Y to terminate processing once the files you need have been restored.

    Examples

    1. If you mistakenly delete the file USER1:[WORK.SEPT]INVOICES.DAT but it has been backed up to a save set named NIGHTLY.BCK, you could restore it using the following command:


      $ BACKUP
      _From: MUA0:NIGHTLY.BCK/SELECT=[WORK.SEPT]INVOICES.DAT
      _To: USER1:[WORK.SEPT]INVOICES.DAT      
      

    2. You can also use wildcard characters to restore more than one file. For example:


      $ BACKUP/LOG
      _From: MUA0:NIGHTLY.BCK/SELECT=[WORK.SEPT]INVOICES*.*
      _To: USER1:[WORK.SEPT]INVOICES*.*
      %BACKUP-S-CREATED, created USER1:[WORK.SEPT]INVOICES_01.TXT;1 
      %BACKUP-S-CREATED, created USER1:[WORK.SEPT]INVOICES_02.TXT;1 
      %BACKUP-S-CREATED, created USER1:[WORK.SEPT]INVOICES_03.TXT;1 
      %BACKUP-S-CREATED, created USER1:[WORK.SEPT]INVOICES_04.TXT;1 
      %BACKUP-S-CREATED, created USER1:[WORK.SEPT]INVOICES_05.TXT;1 
      %BACKUP-S-CREATED, created USER1:[WORK.SEPT]INVOICES_06.TXT;1
         .
         .
         .
      

      The /LOG qualifier displays the file specification of the files that you restored.

    3. The following example restores files from the magnetic tape save set NOV12SAVE.BCK to subdirectories of the directory [LYKINS]:


      $ BACKUP TAPE:NOV12SAVE.BCK [LYKINS...]
      

    4. To restore a specific file from a save set, use the input save-set qualifier /SELECT. In the following example, the file STRAT1.DAT in the directory [LYKINS.GLENDO] was deleted accidentally. The user, who previously saved the file to a save set named NOV2SAVE.BCK, uses BACKUP to restore the file to the directory. Next, the user enters the DIRECTORY command to confirm that the file has been restored to the subdirectory [LYKINS.GLENDO].


      $ BACKUP
      _From: MIA0:NOV2SAVE.BCK/SELECT=[LYKINS.GLENDO]STRAT1.DAT;5
      _To: STRAT1.DAT;5
      $ DIRECTORY STRAT1.DAT
      Directory [LYKINS.GLENDO]
       
      STRAT1.DAT;5
       
      Total of 1 file.
      $
      

    5. Suppose you deleted the entire [REPORTS] directory, which previously contained the following subdirectories:


      $ SET DEFAULT [REPORTS]
      $ DIRECTORY *.DIR
      Directory USER3:[REPORTS] 
       
      INTERNAL.DIR             2 
      PUBLIC.DIR               5 
      SUMMARIES.DIR            1 
      TEST.DIR                 3 
      WEEKLY.DIR               2 
       
      Total of 5 files, 13 blocks.
      $
      

      If you made a backup save set of the directory and subdirectories, you could restore them. For example:


      $ BACKUP MUA0:MAY-10.BCK/SELECT=[REPORTS...] USER3:[REPORTS...]
      

      This command restores all the files in the [REPORTS] directory and the subdirectories ([.INTERNAL], [.PUBLIC], [.SUMMARIES], [.TEST], and [.WEEKLY]).

    6. To restore all files from a magnetic-tape save set named NOV12SAVE.BCK to the directory tree from which they were saved, enter the following command:


      $ BACKUP TAPE:NOV12SAVE.BCK/REWIND [*...]
      

      The /REWIND qualifier directs BACKUP to rewind the tape to the beginning-of-tape before beginning the restore operation. This ensures that the save set will be restored even if it is located before the current tape position.

    10.14.1 Accessing Files in Deep Directory Structures

    BACKUP can access a file in a directory structure that is a maximum of 32 levels deep. BACKUP can also select a file from within a BACKUP save-set file that was previously in a deep directory (one that is greater than 8 levels deep). On an ODS-2 disk, however, you can restore a file from a directory that is a maximum of 8 levels deep. The following example restores a deep directory structure that is 12 levels deep:


    $ BACKUP MTA1:T.BCK/SAV/SELECT=[A.B.C.D.E.F.G.H.I.J.K.L]*.* DISK:[DIR]*.*;* 
    

    10.15 Backing Up User Disks

    This section explains performing incremental and image backups to disk and tape.

    Note

    Do not use the menu system (which displays when you boot the OpenVMS VAX operating system CD-ROM) to back up user disks. Use the menu system to back up system disks only.

    In addition, if you back up large user disks on VAX systems, BACKUP might need to page and thereby cause the operation to fail. If this occurs, use online BACKUP to back up those VAX user disks.

    10.15.1 Preparing to Back Up User Disks

    Compaq recommends that you back up your disks with no interactive users logged in and with no applications running. This is because if BACKUP encounters an open file during a save operation, it issues an error message and does not copy the file. Also, because of the way BACKUP scans directories, any activity in a directory (such as creating or deleting files) can cause files to be excluded from the backup.

    Note

    The first time you back up a disk, you must perform an image backup using the BACKUP/IMAGE/RECORD command before you perform regular incremental backups. The image backup saves a copy of the entire disk and marks each file as being saved. Subsequent incremental backups assume that an image backup has been performed; only new or modified files are saved.

    If an image backup is not performed first, the incremental backups save more files than might be necessary to ensure that an incremental restore operation will be successful.

    You can instruct BACKUP to save open files by using the /IGNORE=INTERLOCK qualifier on the BACKUP command, as described in Section 10.18.3. However, open files saved by BACKUP might contain inconsistent data, depending on the applications that are writing to the open files. BACKUP reports a message if either:

    However, if the file is accessed for writing from a remote node when BACKUP finishes reading the file, no message is displayed because BACKUP cannot detect the access.

    If a file with the specified version already exists, BACKUP reports the following error message:


    RMS-E-FEX, file already exists, not superseded 
    

    How to Perform This Task

    If several users are on your system, notify them that a disk backup is about to take place. If you have the OPER privilege, you can notify users with the REPLY/ALL command, as follows:


    $ REPLY/ALL "System Backup About to Begin -- Open Files Will Not Be Backed Up"
    

    When you enter this command, each interactive terminal on the system displays the following message:


    Reply received on MYNODE from user SYSTEM at VTA28:   23:35:11 
    System Backup About to Begin -- Open Files Will Not Be Backed Up 
    

    10.15.2 Performing Image Backups to Tape

    As described in Section 10.2, an image backup of a disk provides you with an exact logical copy of all the files on the disk. You should perform image backups with no interactive users on the system because of open file considerations (described in Section 10.15.1). Also, system performance can be affected during the backup process, so it is best to schedule the backup during the least busy times for your system. You can optimize the speed of the backup procedure by ensuring that certain process and system parameters are set properly (as described in Section 10.7).

    How to Perform This Task

    To perform an image backup, use the BACKUP command in the following format:

    BACKUP/IMAGE [/RECORD] input-device  output-specifier [/LABEL=label] [/REWIND] 
    

    The /IMAGE qualifier identifies the backup operation as an image backup. The /RECORD qualifier is optional and records the current date and time in the file header record of each file that is backed up. You must use the /RECORD qualifier if you are planning to perform future incremental backups. Specify the name of the disk you are backing up as the input-device; do not specify individual files. The /REWIND qualifier is optional depending on whether you want to initialize the tape. The /LABEL qualifier identifies the label of the tape.

    Examples

    1. The following example shows how to create an image backup of a disk on your workstation. If the disk is named DKA100:, and the tape cartridge drive is named MKB100:, you could perform the image backup by entering the following commands:


      $ INITIALIZE MKB100: WKLY(1)
      $ MOUNT DKA100: DISK$1(2)
      %MOUNT-I-MOUNTED, DISK$1 mounted on _DKA100:
      $ BACKUP/IMAGE/RECORD/VERIFY
      _From: DKA100:
      _To: MKB100:FULL02.SAV/LABEL=WKLY(3)
      %BACKUP-I-STARTVERIFY, starting verification pass
      

      In this example, the individual commands perform the following actions:


      Previous Next Contents Index

        [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
        privacy and legal statement  
      6017PRO_046.HTML