Solved

RoboCopy question

Posted on 2012-03-27
3
948 Views
Last Modified: 2012-06-27
I am preparing to retire/replace a NAS on our corporate LAN. Total data is approx 600GB, much of which is static data but there are quite a few documents, spreadsheets, and other documents scattered about in users folders. I've used RoboCopy to copy the majority of our data to the new NAS (with permisssions, etc..). However I'm not sure which switches to use on the command line for the "final" copy, which will move all of the documents/files that have changed since the bulk move. I want to copy only the new/modified files, based on size and timestamp. I've read that RoboCopy can accomplish this, but the descriptions on the command line switches were not clear enough for me. Should I just run the Mirror switch or something else? If possible, please provide an example.

Thanks in advance,
0
Comment
Question by:ROMAD77
3 Comments
 
LVL 59

Assisted Solution

by:Darius Ghassem
Darius Ghassem earned 100 total points
ID: 37771652
I would use RichCopy which is the latest version of Robocopy.

http://blogs.technet.com/b/keithcombs/archive/2009/03/22/richcopy-bulk-file-copy-tool-released-get-it-here.aspx

The features you are asking for are in both Robopy Copy and RichCopy. You can use both within a GUI as well to make the configuration easier for you
0
 
LVL 83

Accepted Solution

by:
oBdA earned 200 total points
ID: 37772954
robocopy will by default only copy files that aren't in the target already, so you can just run the former command again.
If you want the source and destination folders to be identical after the copy, you need to use /mir to delete files in the target that have been removed in the source since a former copy.
Then you might want to set /r (retry) and /w (wait) to something more useful in a LAN, like /r:2 /w:1.
I usually use /nfl (no file list) and /ndl (no directory list) to reduce the log file size (unless you really want a list of successfully copied files); errors will still be logged. (Note that when using /nfl /ndl, you won't see much output, but robocopy will still be working ...).
Use /np if you're logging to a text file, otherwise the log will be filled with control characters.
Depending on your NAS, you might need to use /fft (2 second time granularity) as well, not all NAS OSs simulate NTFS well enough to offer the full time resolution, so robocopy might think that source files and target files are different, even though they're the same.
So to sum it up:
robocopy.exe "S:\ource\Folder" "T:\arget\Folder" /copyall *.* /r:1 /w:1 /mir /nfl /ndl /np /tee /log:"robocopy-20120327.log"
Add /fft if robocopy keeps copying files that you know are already in the target in the same version; normally, you should see a high number of folders and files in the "Skipped" column (files/folders already in the target) in the job summary when doing reruns.
Add "/mir" (which can delete files in the target, see above!) once you're sure the copy is running correctly (note that files tagged as "*EXTRA" in robocopy's output are files that will be deleted in the target when /mir or /purge is active, because they're not in the source anymore).
Note the nice "/L" switch as well, which tells robocopy to simulate a copy run and only log what would be copied, but not actually copy/delete anything, so you can check if your command is actually doing what it should.
0
 
LVL 2

Author Closing Comment

by:ROMAD77
ID: 37777310
Thanks for the responses, this is what I was looking for.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
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 show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

912 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

21 Experts available now in Live!

Get 1:1 Help Now