ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Copy-Task
Date Wed, 01 Feb 2006 10:14:24 GMT
Stefan Bodewig wrote:
> On Tue, 31 Jan 2006, Markus M. May <> wrote:
>> Now I just would like to copy files which are not already on the
>> remote repository. This cannot be done using the standard ant-task
>> copy, since the jars on the local system do have a newer timestamp.
> Apart from using the present selector (I've seen the mail 8-), maybe
> you should revisit your sync procedure.
> Why is the local timestamp different from the one on the remote
> repository?  rsync or Ant's sync task or even just copy should give
> you the ability to preserve the timestamps.

Unless all dev systems are in the same cluster or a properly configured 
NTP system is keeping the clocks in lockstep, and provided all boxes 
TZone settings are consistent, you will probably encounter clock skew 
when files are uploaded, complicating dependency logic.

- the preservelastmodified attribute of copy can  be used to force set 
the time of created remote files to that of the local one.

-the granularity attribute of <copy> can be set to allow a broader than 
normal clock skew

-you can use the <different> selector to do byte for byte comparisons of 
files. But that pulls all the remote data down and can clog a network

I'd try the first two and then go to #3 if there is no other choice.

If you really wanted to do this properly, I'd consider creating strong 
hashes of the files and saving them remotely, doing the same for the 
local files and then uploading only those files+checksums whose remote 
checksums are different. That would be custom coding.

The alternative, if you live in a pure unix world, is to delegate 
everything to rsync.


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

View raw message