19 January 2014

How to exclude a directory on the destination while using the mirror switch in a Robocopy

I ran into a situation where we had to mirror our local DFS to all of the remote DFS locations. The problem was that there was one directory in each of the remote shares that was unique to that location and had to remain untouched. The first thing I thought of was to have powershell parse through the base directory trees and perform a recursive robocopy on each base. There were 177 with thousands of subdirectories under each one. That was just too much. I finally figured out to make sure there was also a directory in the source DFS named the same as the one in the destination that is to remain unchanged. Once that directory was in the source, I was able to exclude the directory from the source and it left the directory in the destination untouched. 

0 comments:

Post a Comment