views:

257

answers:

1

We have a website with all the media (css/images) stored in a media folder. The media folder and it's 95 subdirectories contain about 400 total files. We have a Cruiscontrol project that monitors just the media directory for changes and when triggered copies those files to our integration server.

Unfortunately, our integration server is at a remote location and so even when copying 2-3 files the NANT task is taking 4+ minutes. I believe the combination of the sheer number or directories/files and our network latency is causing the NANT task to run slow. I believe it is comparing the modified dates of both the local and remote copy of every file.

I really want to speed this up and my initial thought was instead of trying to copy the whole media folder, can I get the list of file modifications from CruiseControl and specifically copy those files instead, saving the NANT task the work of having to compare them all for changes.

Is there a way to do what I am asking or is there a better way to accomplish the same performance gains?

+2  A: 

This sounds like a job for RoboCopy. Use NAnt to bootstrap the execution and let RC do the file synchronization.

Update: digging deeper into the CCNet documentation you'll find the <modificationWriter/> task. Adding this task to your ccnet project will write out an xml file containing information about all the modifications. You should be able to read in the contents of that file in your NAnt script. A suggestion here is to use the NAnt <style/> task to convert the modification xml into a NAnt script containing copy and delete tasks.

Peter Lillevold
This is slow over our network as well because RoboCopy still must timestamps on from the source and destination directories. I just really want to get the list of modified files and move those.
Striker
@Striker: see my updated answer, think this is what you're after.
Peter Lillevold