<!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>
The copy element is one of the top-level operation elements and is used to copy one or more files and/or directories to a specified destination.
The option child-element provides a means to pass an option to the cp command.
![]() |
Note |
---|---|
Not all of the cp command's options are in every implementation. Refer to the documentation for your implementation to determine what options are available. |
The source child-element is required and can be used multiple times to provide multiple source files and/or directories.
The destination child-element is required and can only be used once. A copy can only have one destination.
The base attribute allows you to specify the directory in which the operation will be performed. For a better description, see Element : <base>.
<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