You could use the ForEach command to get a list of the files in each
folder and delete any files that are in your target folder and not in
your source folder. Then do your copy.
Or, you could get a tool like Beyond Compare (awesome tool for the
money) and use the exec task to have it sync the folders. You can find
this tool at www.scootersoftware.com <http://www.scootersoftware.com/> .
BOb
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Friedemann
Sent: Thursday, May 24, 2007 5:05 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Syncing two folders
Hey all,
I've got two folders on the same machine that I'd like to keep in sync.
One folder (the source) has files that are added, deleted, and edited
frequently. I'd like to set up something that would sync the source
folder with a destination one. Currently, I've got two options:
1. Use the copy command (which from what I understand is smart and will
only copy new/modified files), but any files that were deleted from the
source folder will remain in the destination one.
2. Remove everything from the destination folder and then just copy the
entire source folder into there. This sucks because the folders are
often > 500 megs.
Does anybody know of a better option?
Thanks,
-Chris
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users