CL Command Reference - CPYOPT
CL Command List > CPYOPT Reference
Description:
The Copy Optical (CPYOPT) command copies a specific file, all files, new files, or changed files in a specified directory to another directory or to another optical volume. This command also allows you to:
. Create a directory in which to copy the files.
. Copy all subdirectories and their files for a specified directory.
. Replace an existing file with the same name.
If the from-volume or the to-volume is a backup optical volume, the names of the directories, the subdirectories, and the files do not change during the copy operation. The creation and modification dates and times of a directory, a subdirectory, or a file also do not change during the copy operation.
Restriction: To use this command you must have *USE authority to the authorization list securing the volume being copied (FROMVOL) and *CHANGE authority to the authorization list securing the new volume (TOVOL).
Examples:
Example 1: Copying All Files in All Directories
CPYOPT FROMVOL(VOL01) FROMPATH(กฏ/กฏ) TOVOL(VOL02)
CPYSUBDIR(*YES) SLTFILE(*ALL) CRTDIR(*YES)
This command copies all files in all directories and subdirectories from the optical volume VOL01 to the optical volume VOL02. Directories are created on volume VOL02 if they do not exist. If the files already exist on volume VOL02, they are replaced.
Example 2: Copying Changed Files
CPYOPT FROMVOL(VOL01) FROMPATH(กฏ/DIR1/DIR2กฏ) TOVOL(VOL02)
This command copies all changed files in the directory /DIR1/DIR2 to the same files on the optical volume VOL02.
Example 3: Copying Files From a Backup to a Primary Volume
CPYOPT FROMVOL(VOL01BACKUP *BACKUP) FROMPATH(กฏ/DIR1กฏ)
TOVOL(VOL02) CPYSUBDIR(*YES)
This command copies all files and subdirectories in the directory /DIR1 on the optical backup volume VOL01BACKUP to the same files on the primary optical volume VOL02.