Element : <copy>

Syntax

<!ELEMENT copy           (option*, source+, destination)>
<!ATTLIST copy
          base           CDATA #IMPLIED>

This element occurs in : Element : <alfs> | Element: <stage>

See also : Element: <option> | Element: <source> | Element: <destination>

Description

The element copy is one of the top-level operation elements. It is used to copy a file and/or directory into a destination file or directory.

The sub-element option provides a means to pass an option to the cp command.

[Note] Note

Not all of the cp options are in every implementation. Refer to the documentation for your implementation to determine what options are available.

The element source is required and can be used many times to provide multiple source locations for a file.

The element destination is required and can only be used once. A copy can only have one destination.

The attribute base allows you to specify the directory in which the command is executed. See Element : <base>.

Examples

<copy base="/usr/src/mypackage">
        <option>force</option>
        <source>config.txt</source>
        <destination>/opt/mypackage/config.txt</destination>
</copy>

The equivalent bash script is :

echo Copying 'config.txt into /opt/mypackage/config.txt'
cd /usr/src/mypackage
cp -f config.txt /opt/mypackage/config.txt