how to use robocopy when getting errors

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 ?

Who is Participating?
Santosh GuptaConnect With a Mentor Commented:

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
oBdAConnect With a Mentor Commented:
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.
ttrbrtsnAuthor Commented:
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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

oBdAConnect With a Mentor Commented:
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

ttrbrtsnAuthor Commented:
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.

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.
Santosh GuptaCommented:
use below switch.

## 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.


## Excludes older files.
oBdAConnect With a Mentor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.