ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brennan Stehling <bren...@offwhite.net>
Subject Re: sync files with Ant?
Date Sat, 15 Mar 2003 16:05:56 GMT
Sorry I did not get back to you all right away.  It has been a busy 
week.

It looks like there are some good places to begin creating an sync task 
for Ant.  I will begin by researching the options that have been 
suggested.  It looks like Commons VFS would be very useful.

I am thinking an sync process can work in 2 ways.  First, the task 
could just sync 2 locations on the same local system.  Second, it can 
expand to work with a remote location to complete an update.  The 
second option may prove to be unnecessary since most systems already 
provide a facility to map remote drives as if they are local drives via 
NFS, Samba, Webdav and others.  These methods can work outside the 
scope of an Ant task so this functionality does not have to fall within 
the scope of this work.

As for the the process of updating a destination directory from a 
source directory there are many ways to go.  With rsync it reads entire 
blocks of storage for comparison.  Using a Java options I think I will 
just go file by file and recursively drop into each directory until the 
process is complete.  Once I compare files I will simply trigger a copy 
process the moment there is a difference detected.  And based on the 
options provided by the user it could also delete files in the 
destination which do not exist in the source.  To start I will just use 
a normal copy process and delay a diff/patch method for later.  I will 
look for a diff/patch capability in utilities in the Commons projects.

Hooking in this process into Ant is where I will need help.  Now that 
my MacOS X laptop has Java 1.4.1 I may have more luck with SAX and 
compiling Ant.  I think I am just missing a customized ant.properties 
to help find a SAX parser.  Any help in that area is appreciated.

I will also need a little more documentation for the Ant architecture.  
Is there anything written that I can read?

Thanks much,

Brennan

On Monday, March 10, 2003, at 10:30  AM, Adam Murdoch wrote:

> Hi,
>
> Commons vfs has a set of tasks for shipping files around between local 
> and/or
> remote file systems.  This includes a <sync> task, which does pretty 
> much
> what you want.  The tasks support local, ftp, webdav, ssh, samba, etc 
> files
> as source and destination.
>
> The tasks still need some work however.  They aren't as featured as 
> the ant
> equivalents (or as an ant sync task would need to be), and are missing 
> things
> like selectors, mappers and filters.  Nothing a patch or two wouldn't 
> take
> care of :)
>
> So, one option would be to help round out the vfs tasks, rather than 
> starting
> from scratch.
>
> On Sun, 9 Mar 2003 12:17 am, Brennan Stehling wrote:
>> I would like to build a sync capability as an Ant feature but I think 
>> I
>> need some pointers with getting started.  I just tried to build Ant
>> 1.5.2 and got some SAX problems.  I also need to know where to begin
>> once I can get everything compiled.
>>
>> The Ant feature I would like to create is something that I would like
>> to use at work.  I manage a 3 tier development system where we have a
>> development, test and production environment.  I have an Ant script
>> doing all of the building for me and once it is built I want to copy
>> the files to the test and production servers.  To do this I want an 
>> Ant
>> process that does something like rsync, but to start it will just do
>> copying to local directories.
>>
>> The sync process will do a comparison to check if files need to be
>> created, replaced or deleted in the destination location.  The 
>> behavior
>> would also need to be configurable.  I could create software which
>> would do all of this outside of Ant, but it seems like a logical
>> feature to add to Ant.
>>
>> I would appreciate any feedback on this idea...
>>
>> Thanks,
>>
>> Brennan Stehling - Java Developer
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>
> -- 
> Adam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>


Mime
View raw message