Robocopy exclude command (/XD) not working for me....

Hello EE,

I am working on a network drive migration task and all has been going well with this command which will copy source to the destination and keep all the permissions\ACLs intact and gives me a nice log file to review the results. This command does not mess up anything on the source but will mirror it to the destination which is what I want for time being:

robocopy "\source-server\share\folder" "\destination-server\share\folder" /zb /MT:32 /mir /copyall /dcopy:T /V /tee /LOG+:C:\temp\robocopylog.txt /r:0 /w:0

All is well :-) Until I realize that I have tiny window for the final copy before full cutover to the new storage.

Problem: command above is taking close to 31 hours to run for 9TB of data and my cutover time frame is only about 12 hours. I re-run the command every 48 hours to check for changes to the data on source to update the destination and it appears there are millions of small files which are slowing down the copy.

All the data is there just want to keep the destination up to date with new robocopy command and slim down the time without jeopardizing the data or permissions\ACLs.

I have narrowed down a couple folders I could exclude from these subsequent copies to shave down the 31 hours to roughly 9 hours by reviewing the data.

I have been trying out the /XD switch and cannot get it to work.

Here is a example of the /XD added to the command;

robocopy "\source-server\share\folder" "\destination-server\share\folder" /XD \source-server\share\folder-to-exclude /zb /MT:32 /mir /copyall /dcopy:T /V /tee /LOG+:C:\temp\robocopylog.txt /r:0 /w:0

I have also tried;

robocopy "\source-server\share\folder" "\destination-server\share\folder" /zb /MT:32 /mir /copyall /dcopy:T /V /tee /LOG+:C:\temp\robocopylog.txt /r:0 /w:0 /XD \source-server\share\folder-to-exclude

No luck....

Any tips or tricks on what I could try out next?

Thank you
operationsITAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

operationsITAuthor Commented:
Got an answer from the guru's on the web:

I think the exclude directory option just takes one or more folder names - as in just the name of the folder and not the full path name of where to find it.
Helpful if you wish to exclude a folder called temp wherever it may appear, but less useful if you don't want to exclude folders of that name universally.

This worked to resolve! :-)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mitul PrajapatiJunior IT EngineerCommented:
What is the path of folder-to -exclude ?

In your command
Source path:                       \source-server\share\folder
Destination path:              \destination-server\share\folder
folder-to-exclude path:    \source-server\share\folder-to-exclude    (It is not possible)

For example;

Parent folder name:                                        (D:\Parent)
Sub folders name under parent folder :      (D:\Parent\Orange  and D:\Parent\Red)

Now, If i want to copy only sub folder name Orange and exclude sub folder name Red

My robocopy command would be

Robocopy D:\Parent C:\Parent /e /XD D:\Parent\Red

You can keep rest command to fulfill your needs.  Good luck
1
operationsITAuthor Commented:
It was the best option for the question

https://ss64.com/nt/robocopy.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.