|
|
|
|
Copying and Transferring Files
Methods of Transferring Information summarizes the methods you can use to transfer information.
Method | Description |
---|---|
DCL command
COPY
|
Most frequently used method
for transferring
information.
|
Convert utility (CONVERT)
|
On a local system, allows
you to change the organization of a file from sequential to indexed,
for example.
|
Exchange utility (EXCHANGE)
|
On a local system, allows
you to access disk and tape volumes that are formatted for operating
systems other than OpenVMS. You can use EXCHANGE to transfer files
between foreign volumes and standard Files-11 volumes.
|
DCL command EXCHANGE/NETWORK
|
Allows
you to transfer files via the network between OpenVMS and other operating
systems. The command is useful for transferring files between nodes
that use OpenVMS and those that do not. The file is copied in such
a way that it is meaningful on OpenVMS and other operating systems
as well.
|
Backup utility
(BACKUP)
|
With tapes, the only means
of copying entire directory trees or files that are not sequentially
structured. See
Backing Up Files and Directories to a Save Set for information about
using BACKUP to copy files.
|
CDRECORD.COM
|
Lets you transfer files to a CD-R disk
to create your own CD-ROM. Available on some AlphaServers.
|
The COPY command, the Exchange utility, the DCL command EXCHANGE/NETWORK, and CDRECORD.COM are explained in the following sections.
In many cases, you can copy information without physically transporting media. Perhaps you want to copy files between systems that are not connected by a communications link. If so, you must be able to move your files physically from one location to another. A convenient way is to copy your files to a portable volume, such as a tape reel, tape cartridge, or disk pack, and then carry that volume to the location of the other system.
The following sections describe how to perform these tasks:
Task | Section |
---|---|
Copy files
to disk volumes
|
Copying Files to Disk Volumes
|
Copy files
to tape volumes
|
Copying Files to Tape Volumes
|
Continue to
copy at the end of a tape
|
Continuing to Copy at the End of a Tape
|
Use the Exchange
utility to copy files
|
Using the Exchange Utility (EXCHANGE)
|
Use the DCL
command EXCHANGE/NETWORK to transfer files over a network
|
Using the EXCHANGE/NETWORK Command
|
Use CDRECORD.COM to create
a CD-ROM
|
Creating a CD-ROM
|
Copying Files to
Disk Volumes
Before you can copy files to a disk volume, you must perform
the following actions:
The default format for files on disk volumes is Files-11 Structure Level 2. You can also initialize disks in the Files-11 Structure Level 1 format, which is the format used by other HP operating systems, including RSX-11M, RSX-11M-PLUS, RSX-11D, and IAS.
When you copy files from disks to standard-labeled disk volumes, the following items are not preserved:
You can use the COPY command to copy the highest version of all the files in your default directory to another directory on that volume.
The default format for files on tapes is the standard-labeled volume. The OpenVMS system supports sequential, relative, and indexed files on disks, but you can copy only sequential files to standard-labeled disk volumes. The only valid record formats are variable-length and fixed-length.
When you copy files with tape file names from magnetic tape to disk, specify a standard OpenVMS file name for the output file name specification. If you do not specify an OpenVMS file name on output, your process receives the following error message:
RMS-F-FNM, error in file name
This message indicates that the tape file name is not a valid
OpenVMS file name.If you enter the COPY command with the /LOG qualifier, the system sends a message to the current SYS$OUTPUT device after each file has been copied. To verify that the files were successfully copied, use the DIRECTORY command.
The CREATE/DIRECTORY command in this example creates a disk directory file named [PUBS] on DMA3:, and the DEFINE command defines the logical name P as DMA3:[PUBS]. The COPY command copies the highest version of each file in the current default directory and in the directories [PRIMER] and [COMMANDS] to the newly created directory.$
CREATE/DIRECTORY DMA3:[PUBS]
$
DEFINE P DMA3:[PUBS]
$
COPY *.* P
$
COPY [PRIMER]*.* P
$
COPY [COMMANDS]*.* P
For this example, assume that the disk device DMA5: has been allocated to your process and that a disk volume has been initialized and mounted on that device. Also assume that you have a directory called PRIVATE already created on that volume.$
COPY *.* DMA5:[PRIVATE]
The COPY/LOG command in this example copies the tape file %&*?!SKI!#" (# means space) to the file SEASON.DAT on the default disk and directory, WRKD:[MANUAL]. To copy the file to disk, you must specify a new file name. (The OpenVMS software provides defaults for segments of the file specification that are not specified.)$
COPY/LOG MTA1:"%&*?!SKI! """ SEASON.DAT
%COPY-S-COPIED, MTA1:[]"%&*?!SKI! """.;1 copied to WRKD:[MANUAL]SEASON.DAT;1 (120 records)
In this example, the COPY/LOG command specifies wildcard characters for the file name and file type. Therefore, the system copies the only two files on the tape volume to the disk volume.$
COPY/LOG MTA0:*.* *
%COPY-S-COPIED, MTA0:[]TASTETEST.DAT;1 copied to WRKD:[FOOD]TASTETEST.DAT;1 (249 records)
%COPY-S-COPIED, MTA0:[]ALLAT;1 copied to WRKD:[FOOD]ALALL;1 (48 records)
%COPY-S-NEWFILES, 2 files created
The COPY/LOG command string specifies that all files on the volume mounted on tape volume MTA1: are to be copied to the current default disk and directory WRKD:[EX]. However, the system does not copy files with tape file names, but, instead, returns an error message.$
COPY/LOG MTA1:*.* [EX]
%COPY-S-COPIED, MTA1:[].DAT;1 copied to WRKD:[EX]TEST.DAT21 records
%COPY-E-OPENOUT, error opening WRKD:[EX]"%&*()!SKI! """.;1 as output
-RMS-F-FNM, error in file name
%COPY-W-NOTCOPIED, MTA1:[]"%&*()!SKI! """.;1 not copied
%COPY-E-OPENOUT, error opening WRKD:[EX]"SANFRAN%%%""".;1 as output
-RMS-F-FNM, error in file name
%COPY-W-NOTCOPIED, MTA1:[]"SANFRAN%%%""".;1 not copied
%COPY-S-COPIED, MTA1:[]OPENVMS_LONG$FILE_NAME.LONG_EXT;1 copied to WRKD$:[EX]OPENVMS_LONG$FILE_NAME.LONG_EXT;1 (80 records)
%COPY-S-COPIED, MTA1:[]C6.JOU;1 copied to WRKD:[EX]C6.JOU;1 (4 records)
%COPY-S-NEWFILES, 2 files created
$
COPY/FTP sys$login:login.com -
_$
system.bldg.corp.com"username password"::sys$login:login.tmp
Copying Files to Tape Volumes
You can use the
COPY command to copy files from a disk volume to a tape volume.
The procedures are similar to those for copying files from one disk
volume to another. One difference, however, is that magnetic tapes
are sequential-access devices and do not have directories. You must set up (initialize
and mount) a tape device before copying disk files to a tape volume.
(The characteristics of tape files are described in
Accessing Tape Files.)
The entire set of Files-11 file names is supported for magnetic tapes. You can copy a disk file with the following file name to a magnetic tape volume without having to modify the file name:
THIS_IS$AN_OPENVMSLONG_FILE.LONG_TYPE
Most systems that are not OpenVMS do not use file names longer than 17 characters. |
The following steps show how to use DCL commands to copy files from a default directory on a disk volume to a standard-labeled magnetic tape volume. Included in the steps are examples showing how to allocate, initialize, and use a magnetic tape to copy a set of your disk files.
To copy files from a default directory on a disk volume to a standard-labeled tape volume, follow these steps:
This ALLOCATE command requests the allocation of a tape drive whose name begins with MT. The logical name TAPE_DEVICE in this case refers to the MARS$MTA2: drive.$
ALLOCATE MT: TAPE_DEVICE
%DCL-I-ALLOC _MARS$MTA2: allocated
The INITIALIZE command specifies the logical name for the volume (TAPE_DEVICE, which in this case refers to MTA2:) and the volume label for the tape volume (GMB001). The label can be no longer than six characters. The /PROTECTION qualifier defines a protection code restricting group access to read and allowing no world access.$
INITIALIZE TAPE_DEVICE: GMB001/PROTECTION=(GROUP:R,WORLD)
The MOUNT command specifies the device name and volume label of the volume on the device. The COPY command copies the highest version of each file in your default directory onto the tape. The file names, file types, and version numbers of the output files default to the same file names, file types, and version numbers as the input files.$
MOUNT TAPE_DEVICE: GMB001
%MOUNT-I-MOUNTED, GMB001 mounted on _MTA2:
$
COPY *.* TAPE_DEVICE:
This DIRECTORY command lists the file names and file types of all files on the tape.$
DIRECTORY TAPE_DEVICE:
If you do not dismount and deallocate the magnetic tape, the system does so automatically when you log out.$
DISMOUNT TAPE_DEVICE:
$
DEALLOCATE TAPE_DEVICE:
The following examples illustrate ways of copying files to tape volumes.
For this example, assume that MTA2: has been allocated to your process and that a tape volume has been initialized and mounted on that device. The COPY command writes files to the MTA2: tape volume.$
COPY *.* MTA2:
In this command for copying from disk to tape, a tape file name is specified as the output file specification. Note that the trailing space in the file name %&*?!SKI!#"# (where # means space) is not present because trailing spaces are not significant in tape names.$
COPY/LOG FORTAP.DAT MTA1:"%&*?!SKI! "" "
%COPY-S-COPIED, WRKD:[MANUAL]FORTAP.DAT;1 copied to MTA1:[]"%&*?!SKI! """.;0 (120 records)
In this example, a long file name with a long file type is copied to the tape volume MTA1: with the same file name and type as on the disk volume.$
COPY/LOG OPENVMS_LONG$FILE_NAME.LONG_EXT MTA1:
%COPY-S-COPIED, WRKD:[MANUAL]OPENVMS_LONG$FILE_NAME_EXT;1 copied to MTA1:OPENVMS_LONG$FILE_NAME.LONG_EXT;1 (80 records)
In this example, all files with a two-character file name and a file type of .JOU are copied to the tape volume MTA1: with the same file name and type as on the disk volume. Version numbers are preserved.$
COPY/LOG %%.JOU;* MTA1:*.*
%COPY-S-COPIED, WRKD:[MANUAL]C6.JOU;1 copied to MTA1:[]C6.JOU;1 (4 records)
Continuing to Copy
at the End of a Tape
When you are copying to or from a tape and that tape reaches
the end, the system suspends processing and sends a request to mount
the next tape in the volume set. An operator communication manager
(OPCOM) message similar to the following one is displayed at the
terminal:
%%%%%%%%%%% OPCOM, 14-MAY-2000 15:23:31.78 %%%%%%%%%%%
request 3, from user PLAW
MOUNT new relative volume 2 (DW0QT2) on MTA1:
If automatic volume switching is disabled or if the tape file system cannot mount a given volume, you might need to mount a continuation volume in a volume set. See Mounting Continuation Volumes in a Tape Volume Set for information about mounting continuation volumes.
Using the Exchange Utility (EXCHANGE)
The Exchange utility (EXCHANGE) converts the format of files,
as appropriate, when copying files between volumes of different
structures. EXCHANGE recognizes all Files-11 and RT-11 disk volumes
on OpenVMS devices, as well as all DOS-11 and RT-11 formatted volumes
on 9-track tape devices.
For more information about how to use EXCHANGE and for a description of all EXCHANGE commands, qualifiers, and parameters, refer to online help or the archived manual OpenVMS Exchange Utility Manual .
Using the EXCHANGE/NETWORK Command
Use
the DCL command EXCHANGE/NETWORK to transfer files to and from operating
systems that do not support OpenVMS file organizations. This transfer
occurs over a DECnet communications link that connects nodes that
are both OpenVMS and not OpenVMS operating systems.
Use the EXCHANGE/NETWORK command to perform the following operations:
For details on using the EXCHANGE/NETWORK command, refer to online help or the HP OpenVMS DCL Dictionary.
To issue the EXCHANGE/NETWORK command, use the following format:EXCHANGE/NETWORK input-filespec[,...] output-filespec
where:
input-filespec
|
Specifies the name of an
existing file to be transferred. (Wildcard characters are allowed.)
|
output-filespec
|
Specifies the name of the output file
into which the input is to be transferred.
|
The command in this example transfers the file MYSYS_FILE.DAT, which is located in the current default device and directory, to the file FOREIGN_SYS.DAT on node FOO, which is not an OpenVMS node. By default, the command automatically determines whether the transfer method should be block or record I/O.$
EXCHANGE/NETWORK MYSYS_FILE.DAT FOO::FOREIGN_SYS.DAT
|
|