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: Backing Up Files and Directories Backing Up Files and Directories
go to next page: Backing Up User DisksBacking Up User Disks
end of book navigation links

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 Restoring User Disks.

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.

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]*.*;*

go to previous page: Backing Up Files and Directories Backing Up Files and Directories
go to next page: Backing Up User DisksBacking Up User Disks