We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Copy the NTFS permissions with robocopy

life_j
life_j asked
on
Medium Priority
13,116 Views
Last Modified: 2011-09-20

How can I copy the NTFS permissions with robocopy. I am using the command robocopy /source /dest /SEC /Mir. When I run this command it does copy the permissins just the 1st time the subsequent permissions are not copied. I even tried robocopy /source /dest /COPYALL /Mir with no luck
Comment
Watch Question

Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
There is a /SECFIX option which sounds like it does this

Steve
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Here you go, checked the help:

http://www.ss64.com/nt/robocopyNT.html
/SECFIX : FIX SECurity info on existing files and dirs.##

So I'd try using /SEC and /SECFIX too.

hth

Steve

Commented:
if you have large amount of files i would consider to use NTbackup
to backup the files and restore them in new location with all folder and permission structure.
it's easy and more safe then just copy.
just backup to file , move the file to new location, restore.
( you have log on faild files because of access denied for example)

but that just me...
:)
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
I tend to disagree.  Robocopy works well, fast, reliable and gives very detailed error messages that can be used to identify what goes on.  NT backup isn't bad but you need twice the disc space somewhere -- e.g. to copy 50Gb you need original 50Gb, 'spare' 50Gb plus final 50Gb to restore to!

Commented:
you mybe right when you backup to file.
most of the time i prefer to move large amount of data with this method by using tape device
instide of move large data across network...
the "backup to file " is just improvisation in case you don't have tape device.
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
True.  If you have arcserve or veritas then you can normally do backup and restore in one as a copy type job but lets get back to the q I guess!

Commented:
it's looks kind of solved... now the author need to reply.

cheers.

Author

Commented:
dragon-it

I already tried with /SEC but wouldn't work. /SECFIX has been removed from the new version of Robocopy
http://www.ss64.com/nt/robocopyNT.html

Commented:
what about:

/SEC : copy SECurity info (both source and dest must be NTFS).##

Commented:
are both source and dest NTFS?
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
That is what he was using already in the Q.  Why not just use the old version of robocopy with /secfix, sorry, didn't know that had been removed from XP version..  How much data changes here, maybe your onyl option is to use /IS presumably together with /SEC or /COPYALL which includes /SEC as fasr as I can see.

"Using the /IS switch alone, with no other switches, forces a total refresh of the destination tree."

I like ROBOCOPY but the one thing I do find is that so many options do pretty well the same as others...

Otherwise perhaps you could combine it with an XCOPY! i.e.

xcopy /t /o source dest

to create directory structure but not files and copy ownership and ACL.

Sorry I have no straight answer, a lot of it depends on how much you are copying ,how much changes all the time, can both sides change, etc.

Steve

Author

Commented:
I need to copy about 6 GB of data.
Does Xcopy copies the NTFS permissions.
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Yes it does when you use the /o switch

Commented:
6GB ??
are you sure you don't want to use backup and restore method?
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Well at 50Mb/sec say for gigabit ethernet it;s only 2 minutes copying...

Commented:
so you deside he have gigabit ethernet ?
OK...

:)
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Well I presume he is aware of backups with NT backup, Veritas etc.. he was asking for how to do it with robocopy or xcopy..... now if he has 10meg hubs I would be a bit worried at copying this much but otherwise not so bad, especially if it is scheduled out of hours ;-)  In any case Robocopy with /MIR or xcopy with /D copies only newer files anyway which might not be the whole 6Gb.

Author

Commented:
Its over the WAN,so might be good idea to do a Windows NT backup. and Restore over it.
But I don't want to use backup utility because I need to update the files every day.WHich can run through robocopy script.

I tried Xcopy but doesn't copy the permissions.
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Then your easiest bet would be to get the older version of robocopy I guess, at least to try.

Over a WAN puts a different spin on it, it always helps to have the facts :-)

I don't suppose you could stick a 2003 R2 server both ends (replicated file areas are much better in R2)

Author

Commented:
Resolved the issue

Robocopy copies the security and NTFS permissions if you are dooing the robocopy for the 1st time. I mean to say that if the destination is empy.But  in case you already have data in the destination then the robocopy wouldn't copy the permissions.

To copy the permissions what I did was ran robocopy /mir /create /copyall to copy the files and with zero size on to a temporary folder .From the temporary folder I again ran a robocopy job as robocopy /sec to the actaul destination directory which copied the file permissions.
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Interesting... and it did that without overwriting the files I suppose because each was seen as new which is why it copies them but you didn't tell it to copy files just securities.  Nice.

Steve
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
Well as an expert yourself you know it is annoying to waste your time on a question for nothing but if that is your choice fine.

Steve
Closed, 250 points refunded.
kb
Experts Exchange Moderator

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
This may have been answered but I need some help. I am trying to copy the permissions only ffrom 2003 to 2008 R2 file servers but when i runt he command it does not work i get nothng and no security changes that I expect.

syntax used: ROBOCOPY \\2003FS01\APPS \\S008R2\APPS /COPY:SOU /IS /XC /XN /XO /XL
 I get back 25 directories, 25 skipped... No pernmissions copied.. Please help
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.