Solved

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

Posted on 2011-03-11
7
906 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Synchronize a new Active Directory domain with an existing Office 365 tenant
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now