|
|
|
|
Backing Up Files and Directories
When 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.
To make identical disk-to-disk copies of files, use the following format:BACKUP input-specifier output-specifier
$
BACKUP EMPLOYEES.DAT USER1:[BATES.TEST]EMPLOYEES.DAT
This command re-creates the directory structure of user BATES on the disk named USER2:$
BACKUP USER1:[BATES...] USER2:[BATES...]
$
BACKUP [LYKINS...]*.*;* [OWLCR...]*.*;*
Disk-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.
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.
In this example, the individual commands performs the following actions:$
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 $
$
BACKUP [LYKINS...] TAPE:NOV13SAVE.BCK/LABEL=NOV13
$
BACKUP
_From:
DUA0:[MGR]EMPLOYEES.DAT,USER1:[RECORDS]DOOHAN.DAT,EVANS.DAT
_To:
MUA1:MONTHLY_AUG.BCK/LABEL=TAPE1
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).$
BACKUP
_From:
DUA0:[000000]*.*
_To:
MTA1:BACKUP.BCK,MTA2:
$
BACKUP STRATCOL1.DAT DUA1:STRATDAT1.BCK/SAVE_SET
$
BACKUP
From:
STRATCOL1.DAT
To:
NIMBL"ROGERS SANFRANCISCO"::WORK1:[ROGERS]STRATDAT1.BCK/SAVE_SET
$
MOUNT/FOREIGN DUA0:
$
BACKUP [] DUA0:NOV12SAVE.BCK/SAVE_SET
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.$
BACKUP [REPORTS...] MIA11:REPORT.BCK/REWIND/IGNORE=LABEL_PROCESSING
If the contents of the [PAYROLL] directory exceed the capacity of the disk DUA21:, the backup operation fails.$
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
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.$
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
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 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.
Because BACKUP processes files by blocks, comparing files not produced by BACKUP is likely to cause mismatch errors in files that are apparently identical. |
The two ways to perform a compare operation are:
%BACKUP-I-STARTVERIFY, starting verification pass
$
BACKUP/COMPARE MTA0:2MAR1555.BCK [LYKINS]
$
BACKUP/COMPARE UPLIFT.EXE;3 UPLIFT.EXE;4
%BACKUP-E-VERIFYERR, verification error for block 16 of
WRKD$:[LYKINS]UPLIFT.EXE;4
$
BACKUP/IMAGE/COMPARE DBA1: DBA2:
$
MOUNT/FOREIGN DBA2:
$
BACKUP/PHYSICAL/COMPARE MIA0:PHYSBACK.BCK DBA2:
$
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.
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.
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
|
|