There are several parameters which you can specify in order to help you select the files that you want copied.
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.
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.
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.
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.