Solved

Robocopy and how to copy NTFS permissions?

Posted on 2011-09-09
13
1,320 Views
Last Modified: 2012-05-12
I need to copy 100GB from server A to server B. I have full control of server A, but only full control of server B's share.  What robocopy command will retain NTFS permissions?
0
Comment
Question by:victor2008
  • 5
  • 5
  • 3
13 Comments
 
LVL 5

Accepted Solution

by:
Feebleminder earned 188 total points
ID: 36514481


robocopy \\server A\share \\server B\share /E /SEC
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 312 total points
ID: 36516374
http://technet.microsoft.com/en-us/library/cc733145%28WS.10%29.aspx

Example 1--Copies all file properties and sub-directories but not empty sub directories
Robocopy source destination /copy:datsou /s

Example 2--Copies all file properties and sub-directories including empty sub directories
Robocopy source destination /copy:datsou /e

You can choose which file properties you want to copy by selecting from the list below
/copy:<CopyFlags>
Specifies the file properties to be copied. The following are the valid values for this option:
D Data
A Attributes
T Time stamps
S NTFS access control list (ACL)
O Owner information
U Auditing information
The default value for CopyFlags is DAT (data, attributes, and time stamps).

Example /copy:datsou

/sec Copies files with security (equivalent to /copy:DAT).

/s Copies subdirectories. Note that this option excludes empty directories.

/e Copies subdirectories. Note that this option includes empty directories.
0
 

Author Comment

by:victor2008
ID: 36516897
would this also copy NTFS permission?


 /S /E /V /COPY:DATSO/LOG+:C:\temp\robocopy.txt /R:1 /W:2 /NFL /NDL
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:victor2008
ID: 36516910
How can I do an incremental recopy of files changed? I want to copy everything, then do a final copy but of only files changed?
0
 
LVL 5

Assisted Solution

by:Feebleminder
Feebleminder earned 188 total points
ID: 36518233
honestly! pull some ovetime and use robocopy when you are ready to move. Unless you are moving the HDD from one server to the next then you will need to use the command when you are ready to do the move. Doing backups is the only way I know of to reset the archive bit to be able to do a copy of files that have been changed. then restore then to the HDD that you have moved to the new server.
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 312 total points
ID: 36519070
How can I do an incremental recopy of files changed?
What do you mean by that--incremental like an incremental backup? If so, robocopy does not do that, it copies the entire file but you can set that it only copies files that have changed
0
 

Author Comment

by:victor2008
ID: 36519205
Hey Lioneimm, what switches do use so that when I run a final robocopy on the data, it only copies files that have changed?
0
 
LVL 5

Assisted Solution

by:Feebleminder
Feebleminder earned 188 total points
ID: 36519600
Use the /A switch for copying files that have the archive bit set
0
 

Author Comment

by:victor2008
ID: 36519960
doesn't  /MIR do the same thing? Trying to understand the differences between /MIR, /A, and /M.

They all seem to say they will delete files at the destination if they were deleted at the source. but what about changed files with the same name?
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 312 total points
ID: 36520300
When a file is created or modified, the archive bit is set.
/a Copies only files for which the Archive attribute is set but does not change it so in the event that you also use backup software it will not interfere with it.
/m Copies only files for which the Archive attribute is set, and resets the Archive attribute. So if you were to use the /m option it would only copy files that have archive bit it and would then reset it so that you would not copy it next time unless some other use of the file sets the archive bit again.
/purge Deletes destination files and directories that no longer exist in the source
/mir mirrors a directory tree (equivalent to /e plus /purge)--it compares the source and the destination and will make the destination the same as the source and does not work based on whether the archive bit is set or not.

The first two simply set or reset the archive bit on the source files whereas /mir will check both source and destination and will update files from the destination to the source (newer files, new files) and will also remove files and directories in the destination that are no longer in the source (deleted files/folders).

Hope that makes sense and is clear--if not let me know--thanks!
0
 

Author Comment

by:victor2008
ID: 36520502
Thanks lionelmm.  So, sounds like /mir would copy changes also.  Is /Mir the best switch to use then?
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 312 total points
ID: 36522104
If you want to keep the source and the destination the same, identical (a mirror of each other) then /mir is the switch to use
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 312 total points
ID: 36522293
I copied this from the robocopy.doc--may hel you too
By default, Changed, Newer, and Older files are candidates for copying (subject to further filtering, as described later). Same files are not copied. Extra and Mismatched files and directories are only reported in the output log.
Normally, Tweaked files are neither identified nor copied – they are usually identified as Same files by default. Only when /IT is used will the distinction between Same and Tweaked files be made, and only then will Tweaked files be copied.

Use the following switches to override this default behavior.
/XL      Excludes Lonely files and directories.
/IT      Includes Tweaked files.
/IS      Includes Same files.
/XC      Excludes Changed files.
/XN      Excludes Newer files.
/XO      Excludes Older files.
/XX       Suppresses reporting and processing of Extra files.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

763 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