• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1486
  • Last Modified:

Robocopy

I am using robocopy to mirror a Windows volume to a Linux volume.  I'm having a snag with file attributes.

Here's my script:

ROBOCOPY  X:\ \\svr4\V1\004-THURSDAY\X\  /E /R:2 /MIR /NP /XO  /NS /NC /NFL /NDL /NJH /XF *.bak *.tmp aquota.user  /XD *"lost+found" *"recycler"  *"_images" /LOG+:\\svr4\V1\Scripts\Mirror_Full_X.LOG

And here's the error:

2012/08/14 10:52:47 ERROR 5 (0x00000005) Changing File Attributes X:\Projects\_FINBLK\
Access is denied.

I don't care about file attributes as I will be the only person with access to the Linux volumes. How do I stop robocopy from trying to transfer attributes?
0
hgj1357
Asked:
hgj1357
  • 6
  • 3
2 Solutions
 
oBdACommented:
Add "/COPY:DT" to your command line to exclude attributes; default is "COPY:DAT" (Data, Attributes, Time stamp.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Just a guess: try removing the /MIR switch?
0
 
hgj1357Author Commented:
I want this to mirror the source volume.  Will /copy:dt  affect that?  removing /MIR probably would affect the mirror operation, yes?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
oBdACommented:
/COPY:DT will not change the mirroring function, it will just exclude attributes from being copied over.
Removing /MIR would still use the default of "/COPY:DAT".
0
 
hgj1357Author Commented:
Using /COPY:DT

I am now getting this error

2012/08/14 13:24:11 ERROR 5 (0x00000005) Copying File X:\Projects\_FINBLK\Hydrant.dwg
Access is denied.
Waiting 30 seconds...

X:\ is the source volume
0
 
oBdACommented:
Is that the first file it's trying to copy (or in other words: can you copy any file at all from the source to the target, in Explorer if necessary)?
If it's just single files where this happens, add /r:0 /w:0 to your command line options.
0
 
hgj1357Author Commented:
OK. I see what has happened. Some of the folders in the destination are now owned by ROOT and I can't access them from my user login. Whats the quickest way to change properties for all folders and sub folders to my user name. (Linux question, I guess.)
0
 
hgj1357Author Commented:
How do I add "LINUX" to the categories that this question posts under?
0
 
hgj1357Author Commented:
OK. I got the Linux bit;

chgrp -R buggaluggs /V1
chown -R buggaluggs /V1

That'll take an hour or two.
0
 
hgj1357Author Commented:
We have a winner:

COPY/DT
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now