Solved

how to use robocopy when getting errors

Posted on 2014-03-11
8
476 Views
Last Modified: 2014-03-18
robocopy s: t: /E


im trying to copy everything that's on drive S to drive T. but somewhere halfway im getting an error and keeps retrying after 30 seconds. how can i just have it bypass any errors and continue ?

thanks
0
Comment
Question by:ttrbrtsn
  • 4
  • 2
  • 2
8 Comments
 
LVL 83

Assisted Solution

by:oBdA
oBdA earned 375 total points
ID: 39920430
Use /r:nn (retry nn times) and /w:nn (wait nn seconds) to define what happens on errors. In a reliable LAN or a local copy, you can usually use /r:0.
0
 

Author Comment

by:ttrbrtsn
ID: 39920442
so the syntax would be ??? this will try once and if it fails, move on to the next file ?

robocopy s: t: /e /r:0
0
 
LVL 13

Accepted Solution

by:
Santosh Gupta earned 125 total points
ID: 39920446
Hi,

use below command, /R:3 is used for only 3 tries as The default value of N is 1,000,000 (one million retries).

Robocopy /S /E /R:3  sourcePath destinationPath

http://technet.microsoft.com/en-us/library/cc733145.aspx
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 83

Assisted Solution

by:oBdA
oBdA earned 375 total points
ID: 39920459
ttrbrtsn,
yes, that's correct. The default values are somewhat unusable in a LAN.
If you want to check in a batch whether there were errors, use %ErrorLevel%; everything less than 4 is OK.
robocopy.exe ...
if %errorlevel% GEQ 4 (echo Robocopy encountered errors!).

Open in new window

0
 

Author Comment

by:ttrbrtsn
ID: 39920532
now lets say in 2 weeks, i want to copy the same source and target files BUT COPY ONLY what is NEW and has CHANGED. the entire directory is about 1.5TB large. i do not want to have to copy all 1.5TB again. the change or deltas should only be about 10GB max.

thanks
0
 
LVL 83

Expert Comment

by:oBdA
ID: 39920543
Just run the same command again. Robocopy will by default skip files that already exist in the target folder (you'll see these in the column "skipped" in the copy summary at the end).
If you want to remove files in the target that have been deleted in the source, add /mir to the arguments. This will make (pretty) sure that source and target will be identical after the copy. Without /mir, any files that have been deleted or moved in the source after the first copy will remain in the target.
0
 
LVL 13

Expert Comment

by:Santosh Gupta
ID: 39920546
use below switch.

/minlad:<N>
      
## Specifies the minimum last access date (excludes files used since N) If N is less than 1900, N specifies the number of days. Otherwise, N specifies a date in the format YYYYMMDD.

OR

/xo
      
## Excludes older files.
0
 
LVL 83

Assisted Solution

by:oBdA
oBdA earned 375 total points
ID: 39920604
Santosh,
there is no need for any additional arguments to "force" robocopy to skip existing files.
robocopy checks if a file with the same name, same date, and same size exists in the target, and if so, it will not copy this file again - by default.
/xo is superfluous in most cases and can actually be harmful:
Let's say a user edits a file on date Z, and this file gets copied in the first run to the other server.
Now the user finds out that whatever he did turned said document to garbage, and he restores the previous version from somewhere with date Y.
If the second copy now runs with /xo, the current (older) copy (as far as the user is concerned) will NOT be copied, because the garbage version on the other server is newer.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Populating a combobox from a text file 8 93
equivalent of dsquery in POWERSHELL (WIN7) 5 295
robocopy 6 64
knowing when local account expires (Windows Server OS-DOS) 5 69
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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