Solved

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

Posted on 2011-03-11
7
927 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

630 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