Required Parameters
- source: The path of the file (including the filename) or directory to copy.
- destination: The path of the file (including the filename) or directory where the file or directory is copied to.
Optional Parameters
- force: Controls whether the operation creates missing directories in the destination path. The allowed values are
trueandfalse. The default istrue. This is commonly used in conjunction with the recurse parameter when you need to mirror the directory structure of the source in the destination. - mask: The pattern used to select the entries to be copied. The default value is
*. (For example, a mask of*.xmlmatches all xml files in the source.) - recurse: Recursively copy files and directories from the source. In this case the destination is assumed to be a directory. The allowed values are
falseandtrue. The default isfalse.
Output Attributes
- file:source: The full path of the source file or directory.
- file:destination: The full path of the destination file or directory.
Examples
Copy a Single File
Recursively Copy a Directory and its Contents
When this script is executed, the directory structure present in/tmp/foo is mirrored in /tmp/bar. Only .xml files are copied over from the source to the destination.