ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gordon <>
Subject Re: How can I exclude a directory's contents but not the directory itself?
Date Wed, 03 Feb 2010 19:49:01 GMT
On Mon, Feb 1, 2010 at 9:18 PM, Stefan Bodewig <> wrote:
> I think you need includeemptydirs="true" on the <sync> element as well.
> Stefan

Thanks Stefan! Here's the working snippet in case anyone else runs
into this problem:

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

Unfortunately, once I got this worked out I soon stumbled on ant's
difficulty with permissions, which prevents executing tomcat's scripts
in the bin directory.

--- Begin Reference ---

Unix Note: File permissions are not retained when files are copied;
they end up with the default UMASK permissions instead. This is caused
by the lack of any means to query or set file permissions in the
current Java runtimes. If you need a permission-preserving copy
function, use <exec executable="cp" ... > instead.
--- End Reference ---

So I decided to go with a native call to rsync instead:

<exec executable="rsync" os="Linux" >
    <arg line="-avzC --exclude=/logs/* --exclude=/work/*
--exclude=/temp/* ${tomcat.template}/ ${build.tomcat}"/>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message