There is a script running which mirrors a bunch of folders from one volume to another. The problem is that now there are going to be subdirectories within those folders at the destination which are not part of the original mirroring script. They are standalone subdirectories and I don't want them purged once the mirroring kicks in. Is there a way for me to use the /xd
switch in robocopy wherein I'd be able to exclude the destination subdirectories.
Example:
robocopy "\\hq04t2fis202\archive\dr" "\\hq04t3fis202\archive\dr" /mir /xd "\\hq04t3fis202\archive\dr\*\hq04s2dba301"
In the above example, there are several directories under \\hq04t2fis202\archive\dr
that are being mirrored. And at the destination, once these directories are mirrored from the source, there is another script which dumps separate subdirectories within each of those directories. So what I want to do is somehow use the /xd switch to avoid purging those subdirectories at the destination.
Also, in the above example, in the /xd
switch, I'm using the "*"
wildcard to mean that I want to include all the directories that fall under the "\\hq04t3fis202\archive\dr"
root folder at the destination.
Need help and suggestions as to whether this is possible, and if it is then how can I do it. So far I've tried and tested many other switches like /xo
, /xx
, but none of them solve my purpose.
Also, /xx
would work except that now it won't delete any folders at the destination at all and it wouldn't be mirroring.
Hopefully I'm not overly confusing everyone here. Let me know if you have any questions.