You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jonathan Gordon <an...@kinobe.com> on 2010/02/01 21:53:29 UTC

How can I exclude a directory's contents but not the directory itself?

I have a directory structure that looks like so:

apache-tomcat-6.0.20/
|-- LICENSE
|-- NOTICE
|-- ...
|-- bin
|   |-- bootstrap.jar
|   |-- ...
|-- conf
|-- lib
|-- logs
|   |-- catalina.2010-01-13.log
|   |-- ...
|-- temp
|-- webapps
`-- work
    |-- Catalina

Using the sync command, I would like to sync everything but the
contents of the logs, temp, and work directories but I would like the
actual directory entries. Such that the synced copy looks like:

apache-tomcat-6.0.20/
|-- LICENSE
|-- NOTICE
|-- ...
|-- bin
|   |-- bootstrap.jar
|   |-- ...
|-- conf
|-- lib
|-- logs
|-- temp
|-- webapps
|-- work

This is what I have so far:

        <sync todir="${build}/tomcat" failonerror="true" overwrite="true">
            <fileset dir="${tomcat}">
                <exclude name="logs/*"/>
                <exclude name="work/*"/>
                <exclude name="temp/*"/>
            </fileset>
        </sync>

But unfortunately that excludes the directories as well. Any ideas?

Jonathan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org