19 January 2014

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

Posted By: Mick Pletcher - 11:12 PM


& Comment

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. 

About Mick Pletcher

My blog is here to help solve issues I have encountered and solved, publish scripts I have written, and educate others in understanding areas that are not well covered


Post a Comment

Copyright © 2013 Mick's IT Blogs™ is a registered trademark.