Solved

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

Posted on 2011-03-11
7
920 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
service checker powershell script 5 44
Organizing Files into folders with powershell 5 26
dropdownlist in asp.net vb. 3 24
Outlook message sensitivity button 5 19
A procedure for exporting installed hotfix details of remote computers using powershell
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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ā€¦

710 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