Solved

Robocopy and how to copy NTFS permissions?

Posted on 2011-09-09
13
1,284 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
Comment Utility


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

Assisted Solution

by:lionelmm
lionelmm earned 312 total points
Comment Utility
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
Comment Utility
would this also copy NTFS permission?


 /S /E /V /COPY:DATSO/LOG+:C:\temp\robocopy.txt /R:1 /W:2 /NFL /NDL
0
 

Author Comment

by:victor2008
Comment Utility
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
Comment Utility
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 24

Assisted Solution

by:lionelmm
lionelmm earned 312 total points
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:victor2008
Comment Utility
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
Comment Utility
Use the /A switch for copying files that have the archive bit set
0
 

Author Comment

by:victor2008
Comment Utility
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 24

Assisted Solution

by:lionelmm
lionelmm earned 312 total points
Comment Utility
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
Comment Utility
Thanks lionelmm.  So, sounds like /mir would copy changes also.  Is /Mir the best switch to use then?
0
 
LVL 24

Assisted Solution

by:lionelmm
lionelmm earned 312 total points
Comment Utility
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 24

Assisted Solution

by:lionelmm
lionelmm earned 312 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now