Link to home
Start Free TrialLog in
Avatar of Chrissycan
Chrissycan

asked on

Robocopy Parameters

I am trying to copy a very large directory structure (400GB) including sub-directories from one location to another location using Robocopy.

However the copy process fails on a few files which means the whole copy operation fails.

Can anyone suggest the exact syntax/parameters which will allow the copy process to continue if particular files fail but where the names of the failing files will be logged to a text file which can be reviewed at a later date.
SOLUTION
Avatar of Miguel Angel Perez Muñoz
Miguel Angel Perez Muñoz
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oBdA
oBdA

robocopy's behavior on failing files is governed by the /r (retry, default 1 million) and /w (wait, default 30 seconds) parameters; they tell robocopy how often to retry a copy operation, and how long to wait (in seconds) between retry attempts. The default values will make robocopy wait for a really long time in cas eof an error, so these need to be reduced. If it's a stable LAN connection, set both to 0.
As far as logging is concerned, you can usually safely use /nfl (no file logging) and /ndl (no directory logging); this will only disable logging of successfully copied files, errors will always be logged. And if you're writing to a log file, use /np (no progress indicator), as this will clutter up the log file with control characters. Use /tee to have console output as well as logfile output.
It's no problem to start robocopy several times; it will by default only copy files that aren't in the target already. If you want to delete files in the target that don't exist in the source anymore (to have identical folder trees), use /mir (includes /e).
robocopy will by default only copy the file data, attributes, and time stamp. (/copy:DAT). For NTFS permissions, add a "S", for Owner an "O", for aUdit an U (shortcut to copy everything is /copyall).
So I'm usually using something like this:
robocopy "S:\ource\Folder" "T:\arget\Folder" *.* /copy:DATSOU /r:0 /w:0 /np /mir /nfl /tee /log:"robocopy-20110425-0325.log"

Open in new window


If you've installed the W2k3 Resource Kit to work with robocopy, check out robocopy.doc in the installation folder, it's a very useful documentation (which was dropped for whatever reason in Vista or later where robocopy is preinstalled).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chrissycan

ASKER

Thanks all for your comments. I'm going to try these and will post back. It will be a while because there are a very large number of files to copy. They are being copied to a NAS Unit.
oBdA

I read your comment and that was indeed the problem I had when I first used Robocopy i.e. it kept displaying waiting 30 seconds when it encountered a problem and never seemed to go beyond that.

I tried your command but it kept giving Access Denied 0X00000005 errors. I googled it and some suggested using copy:DT rather than Copy:DATSOU. This I have found allows the copy process to run.  

I would prefer to stick to your original syntax as much as possible as you obviously know what you are talking about. However I am concerned whether the destination structure will then be exactly the same as the source should a user start to access it.

Chris

.

 The rest of the commend looks perfect if I could get past the "Acess Denied" problem
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oBdA

Thanks again. I'll try that...This one's still on XP.
oBdA

It worked very well. Will get the operator to test all files/permissions.