Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Robocopy and how to copy NTFS permissions?

Posted on 2011-09-09
13
Medium Priority
?
1,383 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 752 total points
ID: 36514481


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

Assisted Solution

by:Lionel MM
Lionel MM earned 1248 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
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.

 

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 752 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 26

Assisted Solution

by:Lionel MM
Lionel MM earned 1248 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 752 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 26

Assisted Solution

by:Lionel MM
Lionel MM earned 1248 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 26

Assisted Solution

by:Lionel MM
Lionel MM earned 1248 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 26

Assisted Solution

by:Lionel MM
Lionel MM earned 1248 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
OfficeMate Freezes on login or does not load after login credentials are input.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

772 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