I have a deploy process that is currently using this robocopy command:
robocopy [source] [destination] /MIR /XF [file pattern] /XD [directory pattern]
The [destination]
may have additional files or directories added to it outside this process that the [source]
does not. The /MIR
flag is present because if I add files or directories to [source]
I want them to appear in the [destination]
. Also, if I remove a file/directory from [source]
that exists in [destination]
I want to remove that from [destination]
. However, this will also remove any of the new files/directories that may have been added to [destination]
.
The /XF
and /XD
flags appear to only restrict the source files/directories. Is there a corresponding way to exclude destination files from the copy? Something to indicate "When doing \MIR
don't delete directories starting with the string 'new'," for example.