Robocopy and how to copy NTFS permissions?

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?
victor2008Asked:
Who is Participating?
 
FeebleminderCommented:


robocopy \\server A\share \\server B\share /E /SEC
0
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
victor2008Author Commented:
would this also copy NTFS permission?


 /S /E /V /COPY:DATSO/LOG+:C:\temp\robocopy.txt /R:1 /W:2 /NFL /NDL
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
victor2008Author Commented:
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
 
FeebleminderCommented:
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
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
victor2008Author Commented:
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
 
FeebleminderCommented:
Use the /A switch for copying files that have the archive bit set
0
 
victor2008Author Commented:
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
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
victor2008Author Commented:
Thanks lionelmm.  So, sounds like /mir would copy changes also.  Is /Mir the best switch to use then?
0
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
Lionel MMSmall Business IT ConsultantCommented:
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
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.

All Courses

From novice to tech pro — start learning today.