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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1594
  • Last Modified:

RoboCopy question

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
ROMAD77
Asked:
ROMAD77
2 Solutions
 
Darius GhassemCommented:
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
 
oBdACommented:
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
 
ROMAD77Author Commented:
Thanks for the responses, this is what I was looking for.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now