Solved

RoboCopy question

Posted on 2012-03-27
3
1,104 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 84

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account 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…

830 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