Using <fileset>, source files and directories can be excluded from the sync. However, it would be very useful to ignore files and directories from the destination. For example, I have a subdirectory 'xdocs' in my destination directory that has lots of files in it and my source directory doesn't have 'xdocs'. When I do a <sync>, 'xdocs' is deleted. I want to ignore 'xdocs' and just synchronize everything else.
*** Bug 25749 has been marked as a duplicate of this bug. ***
It's in CVS HEAD (actually for some weeks now), "just" need to add docs. The example would work as <sync ...> <preserveintarget> <include name="xodcs/**"/> </preserveintarget> </sync>
Team , preserveintarget is not working, still the sync job overwrites the folder/file in the target this is how i'm using this target in my script <sync todir="C:\test2" verbose="true"> <fileset dir ="C:\test1"/> <preserveintarget> <include name="donotcopy/**"/> </preserveintarget> </sync>
preserveintarget ensures your files don't get deleted if they are not part of the source tree. It doesn't have any influence on files that exist in the source tree (use an excludes in your source fileset for that).