ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gordon <ant.u...@kinobe.com>
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 <bodewig@apache.org> 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"
includeemptydirs="true">
    <fileset dir="${tomcat.template}">
	<exclude name="logs/**/*"/>
	<exclude name="work/**/*"/>
	<exclude name="temp/**/*"/>
    </fileset>
</sync>

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 ---
http://ant.apache.org/manual/CoreTasks/copy.html

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}"/>
</exec>

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


Mime
View raw message