Solved

Need Robocopy Help.

Posted on 2010-08-21
8
820 Views
Last Modified: 2012-05-10
Can someone be so kind as to give me the exact command line for coping files from server A to Sever B?  I need to retain NTFS permissions and log the transfer so that I can make sure everything was copied.
Thank you!
0
Comment
Question by:victor2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 12

Accepted Solution

by:
Rant32 earned 250 total points
ID: 33493020
ROBOCOPY "\\ServerA\d$\data" "\\ServerB\e$\destination" /E /COPYALL /LOG+:"c:\copy.log"

If you want to delete files from the destination that no longer exist in the source, add the /PURGE option.

Hope this helps.
0
 
LVL 1

Assisted Solution

by:perplexd
perplexd earned 125 total points
ID: 33493045
I'd do it like this:

robocopy "C:\server A Folder" "\\server B\C$\Target Folder" /MIR /SEC /V /NP /LOG:"<local log path>" /R:1 /W:2 /NFL /NDL

I run this as a nightly scheduled task to sync files daily until I am ready to cut over the network name. This lets you poke through the log every day and fix any perms or other errors until you are getting clean nightly copies.

Switches detail:

/MIR /SEC mirrors with ACLs copied. /R /W shortens the default wait time for locked files. This was making my jobs take all night at 30 second wait and 10 retries. /NP shows no progress to get rid of spam in your logs. /NFL /NDL are no file or directlory logging because, again, the successful copies are just spam in your log. So, with all this, your log shows you the errors, or just a summary if there was no error.
0
 
LVL 12

Assisted Solution

by:Rant32
Rant32 earned 250 total points
ID: 33493212
Yes, you get the ACL, but /SEC will not copy Owner information. If the Creator Owner group is used in the ACL, the effective permissions may not be the same. /COPYALL will copy ACL, Owner and Audit attributes.

Lowering the retries and waits from the default is a good idea though.

One other note: I also recommend to run the command as a member of the Backup Operators group on the source server.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 4

Assisted Solution

by:TechnoButt
TechnoButt earned 63 total points
ID: 33497703
As an aside, purely because I"ve hit this recently myself, if your servers are running SMB 2.0 (ie, newer 2008 boxes) and are speaking over Cisco WAAS (ie, replicating files offsite), there is a bug right now that requires code patching oneither the Cisco WAAS or the Microsoft boxes that are both out of band fixes. If this applies, say so, and I'll try to pull the KB article numbers for you.

The reason I mention it, is that NTFS security lookups fail due to the bug, causing robocopy /sec  or robocopy /copyall or similar to fail (despite most file copies ro communications with SMB 2.0 to work fine).  Annoying somewhat rare issue that took me a bit to resolve recently.

This might be a stretch, but I dropped it here in case you run into the issue.
0
 
LVL 2

Assisted Solution

by:johnnytanki
johnnytanki earned 62 total points
ID: 33498346
Simple usage as below:

net use v: \\serverA\xxx
net use u: \\serverB\yyy
robocopy v:\ u:\ /e /R:2 /W:1 /z /mir >> log.txt

Where V: drive is the source and U: is the destination. It will mirror what is on V to D: which include the NTFS permission. R is the switch for number of Retries on failed copies and W is the Wait time between retries.

User robocopy /??? for more information.
0
 
LVL 12

Assisted Solution

by:Rant32
Rant32 earned 250 total points
ID: 33498695
johnnytanki, your command line will certainly not copy file permissions.
0
 
LVL 1

Assisted Solution

by:perplexd
perplexd earned 125 total points
ID: 33501596
Yes, rant32 is correct, MIR alone will definitely not copy permissions. I never cared about owner permissions in the last few runs I had to do, but I am sure he is right about that as well.
0
 
LVL 12

Assisted Solution

by:Rant32
Rant32 earned 250 total points
ID: 33504547
Then may I suggest this version, a mix of perplexd's solution and mine?

robocopy "source" "destination" /MIR /COPYALL /NP /LOG:"logfile" /R:1 /W:2 /NFL /NDL

source, destination and logfile can be a local path or UNC path.
/MIR  Copy empty directories and delete files that don't exist in the source (same as /E /PURGE)
/COPYALL  Copy all regular file attributes (RSHA) and security, owner and audit attributes
/NP  No progress
/LOG(+)  Log output to file (use /LOG+: to append to existing file)
/R:1  number of retries
/W:2  Wait time
/NFL  No file list
/NDL  No dir list

I left out /V because it logs skipped files that already exist (spam as well).
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
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…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

734 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