Key parameters

There are several parameters which you can specify in order to help you select the files that you want copied.

The parameters include:

To actually copy a file, it must meet all of the above three requirements.

You can use CPYOPT to perform a backup of your optical volumes, but is not the suggested way of doing so. Remember that CPYOPT works on a file basis, therefore if you are copying a large number of files your CPYOPT request could take hours to complete. What options you specify can also affect how long your copy request could run. Review the examples later in this chapter for a comparison of your options and how they may affect your copy request.

Select files to copy

Use the Select files to copy (SLTFILE) parameter to choose which files you want to copy.
  • Your options are: v *CHANGED is the default option. The system will determine if the source file already exists on the target volume. If so, the system will copy the source file only if the source file has changed since performing the last copy. Two sets of dates and times determine if a file has changed: Either the date and time the file was last changed, or the date and time the file attributes were last changed. Specifying DATA(*FILATR) on the Display Optical (DSPOPT) CL command can display these dates and times.
  • *ALL indicates that the system will copy all files on the source volume. The system will replace any files which may already exist on the target media by a new copy from the source volume.
  • *NEW indicates that the system will copy only files which are not currently on the target volume.

If the target volume already contains files, choosing the *CHANGED or *NEW option may result in a longer running CPYOPT request. This is because the system has to make a list of files for both the source and target volume, and then compare them. The time required to do this can become excessive when the volumes contain thousands of files.

Copy subdirectories

Use the Copy subdirectories (CPYSUBDIR) parameter to indicate whether or not to process files in the subdirectories of the specified From path. Your options are:
  • *NO indicates that only files in the specified From path are eligible to be copied. This is the default option.
  • *YES indicates that files in all subdirectories of the specified From path are eligible to be copied. The system creates subdirectories on the target volume if they do not already exist. The newly created subdirectories have the same name as they did on the source volume, even though the parent directory name can be different. A system makes a check prior to the copy operation to ensure that any resulting new path name does not exceed the maximum path name length. The system prevents you from copying the subdirectories of one directory to a subdirectory of that directory on the same volume.

Starting date and time

The system will use the FROMTIME parameter to determine if a file is eligible for copying based on its creation or modification date. All files that were created, changed, or whose attributes have changed, on or after the starting date and time are eligible for copying. You can determine when a file was last created or changed by specifying DATA(*FILATR) on the Display Optical (DSPOPT) CL command. The default values: *BEGIN for Starting date and *AVAIL for Starting time indicates that all files meet the starting date and time requirement. Specifying a starting date and time identifies only files that were created or changed since that date and time as eligible for copying. You can use this parameter to greatly limit the number of files that require processing by CPYOPT. This decreases the time that is required to process the files. You could combine this parameter and the SLTFILE parameter to limit the number of files that need to be checked before copying. You could select only files that were *CHANGED or *NEW after a specified starting date and time.

Examples

Scenario 1 — Copy all files from the source volume: This example shows how to copy all files from the source volume VOL001 to a volume which currently does not contain any files or directories. The system will process all subdirectories of the source volume, create the subdirectories on the target volume, and copy all files.

> CPYOPT FROMVOL(VOL001) FROMPATH(/) TOVOL(CPYVOL001) SLTFILE(*ALL) CPYSUBDIR(*YES) CRTDIR(*YES)

Scenario 2 — Copy all files form the source volume since the last copy request: For this example you have several different option which may take different lengths of time. Your first option would be to issue the same request as Scenario 1 but with a different target volume. The system will copy all the files and directories to the new target volume.

Your second option would be to use the *CHANGED option on the SLTFILE parameter.

> CPYOPT FROMVOL(VOL001) FROMPATH(/) TOVOL(CPYVOL001) SLTFILE(*CHANGED) CPYSUBDIR(*YES) CRTDIR(*YES)

Depending on how many files are currently on the source and target media this request may take a long time to process. First, you must obtain a list of all files on the source media and the target media. Then compare the files in order to determine if any file has changed since the last CPYOPT request. Once that is done, the system will copy only the files that have changed.

The third option is using the *NEW option on the SLTFILE parameter, provided that no existing files changed, but simply added to the source volume.

> CPYOPT FROMVOL(VOL001) FROMPATH(/) TOVOL(CPYVOL001) SLTFILE(*NEW) CPYSUBDIR(*YES) CRTDIR(*YES)

First, you must build option a list of all files that are on both the source and the target volume. Then compare the files before copying any new files.

Your fourth option would be to use one of the SLTFILE options in combination with specifying a starting date and time.

> CPYOPT FROMVOL(VOL001) FROMPATH(/) TOVOL(CPYVOL001) SLTFILE(*CHANGED) CPYSUBDIR(*YES) CRTDIR(*YES) FROMTIME(’04/01/99’ ’00:00:00’)

By specifying a starting time, the system copies only files that were created or changed after 04/01/99 to the target volume.