Solved

Robo copy exclude not working, need help with syntax or whatever the cause is

Posted on 2011-03-11
7
918 Views
Last Modified: 2012-05-11
I have this script I am running and I have a exclude set but it doesn't seem to be working, the share folder is copying fine but the exclude1 and exclude2 are still being copied instead of excluded.

Is there a problem with the syntax or something else? This is for migrating data to a network storage device from a Windows 2003 file and print server. I ran this on another machine and had the same problem.
set Source=\\server\share\

 

set Destination=\\networkstorage\share\

 

set LogFile="C:\CopyLogs\Copy_log.log"

Set Exclude=\\server\share\exclude1\
Set Exclude=\\server\share\exclude2\

robocopy.exe %Source% %Destination% /ZB /MIR /COPYALL /XD %Exclude% /R:5 /W:1 /LOG:%LogFile% /TEE

Open in new window

0
Comment
Question by:REIUSA
  • 5
7 Comments
 

Author Comment

by:REIUSA
ID: 35109015
Also, I have tried the same command above with only one excluded folder and had the same problem. I think I actually left out the extra exclude form the command but either way it didn't work with one exclude either.
0
 
LVL 6

Accepted Solution

by:
LHT_ST earned 250 total points
ID: 35109105
the way you have it set up at the moment, you are changing the variable exclude. its sets to the exclude1 path and then you set it to the exclude2 path so even if it did work it would only exclude the exclude 2 path.

i take it you dont have any spaces in th exclude paths either?
0
 

Author Comment

by:REIUSA
ID: 35109531
I see, if I set to variables for exclude do I need to use the /XD command twice or just once with both %exclude% %exclude2% behind it?

I still don't get why it doesn't work with the XD command even with only one exclude variable.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Assisted Solution

by:Casey Herman
Casey Herman earned 250 total points
ID: 35109791
change this Set Exclude=\\server\share\exclude1\
to this Set Exclude=\\server\share\exclude1\*.*

and see what happens.
0
 

Author Comment

by:REIUSA
ID: 35280450
It's weird, I ran a test on my local PC and on a Netapp share and it worked fine. Is there any reason that much larger amounts of data being copied would cause it not to exclude properly?
0
 

Author Comment

by:REIUSA
ID: 35421599
After fooling around with it a little more I changed it so the exclusion path used the drive letter instead of just the UNC, I have no idea why this would work but it seems like it did.

Changed to something like this....
Set Exclude=\\server\E$\share\exclude1\
0
 

Author Closing Comment

by:REIUSA
ID: 35421601
After fooling around with it a little more I changed it so the exclusion path used the drive letter instead of just the UNC, I have no idea why this would work but it seems like it did.

Changed to something like this....
Set Exclude=\\server\E$\share\exclude1\
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question