copydir - UDM Command

Syntax

copydir source-logical-name=file-specification [destination-local-name=file-specification]


Description

The copydir command initiates a copy operation that recurses into subdirectories.

If the source of the copy operation has subdirectories beneath the location given by the file-spec, UDM will create those directories on the destination side of the transfer and copy their contents as well. If any of the directories already exist on the destination side (relative to the destination file specification), the copy operation will fail if the creatop attribute on the destination side is not set to replace.

The source file specification is given as the value for source host's logical name (which should be either the primary or secondary logical name specified in the open command. An optional destination file-spec may be given as well. If none is given, the current directory (or high-level qualifier) for the destination machine in the transfer session is used.

If no destination server is given in the command (the command contains only the source's logical name and file specification), the other server in the transfer operation is assumed to be the destination and the source filename is used for the destination filename.

If a destination file specification is not given, or contains only a directory sequence, but no filename, the filename of the source file will be used.

The copydir command is available only on UNIX, Windows, and the hfs file systems for z/OS and IBM i.

Parameters

Parameter

Description

source-logical-name

Server acting as the source of the transfer operation.

file-specification

File or files to be copied. It also can specify a directory whose contents should be copied. The file specification can be a single filename, directory name, or a complete path to a file or directory.

The filename (or filename portion of the path) can contain wildcard characters:

  • Wildcard * represents stands for zero or more characters.
  • Wildcard ? indicates a single character.

destination-logical-name

Logical name of the destination server in the transfer.

file-specification

Complete path or filename for the destination file.

Examples


To copy all files in a directory, recursing through all subdirectories:


To copy all files in a directory (same as above) by specifying the directory name only in the source (no wildcards or filename portion is needed):


To copy the files in mydir and all of its subdirectories into another existing directory on the destination side:


To copy an entire directory structure underneath a subdirectories and any files ending in .txt: