Element : <copy>

Syntax


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

This element is an element of : Element : <alfs> | Element: <stage>

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

Description

The element copy is one of the many main operation elements. It is used to copy a file and/or directory into a destination file or directory. The use of wildcards is not supported.

The element option is optional and can be used one or many times to ensure the correct use of the cp command. The following is the currently supported list of options for the cp command :

.

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