Another nasty Robocopy bug

Recently I wrote about bug I found in Robocopy - one of my favorite utilities... And today I found another one.

I am using robocopy for synchronization - which is VERY important part of our framework (if nothing is synchronized, nothing can be executed).

We use one folder for storing all log files. During migration to newer version of framework, I wanted to see only new entries for easier troubleshooting (many log files are not overwriting, but rather appending). So I renamed my Log folder to Log.Backup and tried to run synchronization... I run only backend part - that is part that is missing all checking, creation of required folders etc.

To my surprise my synchronization failed - when I renamed Log.Backup to Log again it was working.

Robocopy reported very strange error:

ERROR : Invalid Parameter #4 : "/Log+:C:\Temp\Log\Robocopy.log"

I am using same syntax for many years, so I was really surprised. I double checked robocopy version to be sure that I didnt accidentaly replaced it with some 3.11 version - nope, I was using current version.

Then I started to have that scary feeling that I know what is wrong - I tried to run it again, this time specifying folder that didnt exist - and I got same error as before.

To summarize it - if Robocopy is not able to write to file, it reports "Invalid parameter". If you specify that you want to store your settings in log file in folder that doesn`t exist - bang, "Invalid parameter".

Tested with newer and older versions of Robocopy - XP010 (Resource Kit), XP026 and XP027 (Vista).

Published Wed, May 14 2008 19:26 by martin
Filed under: ,

Comments

# re: Another nasty Robocopy bug

We recently encountered a problem while using robocopy to copy files from an iomega drive to a network drive.  We staeted receiving errors and eventually the drive became inaccessible, and connecting to any workstation causes the workstation to hang.

We are using version 1.96 of the software and were using the following options /F /E / Z r:1

Have you seen this situation occur before, and are there any options for recovering the drive?  THanks!

Monday, October 27, 2008 3:27 PM by Rae Metcalfe

# re: Another nasty Robocopy bug

We have an alternative to Robocopy if you are interested please let me know and I can go over the technology.  This application copies in parallel and is fast.  AutoClone from AutoVirt.

Tuesday, January 27, 2009 1:14 PM by Eric Robinson

# re: Another nasty Robocopy bug

Hi Eric,

always interested in new technologies :)

Martin

Tuesday, January 27, 2009 1:54 PM by martin

# re: Another nasty Robocopy bug

I had one robocopy running in a dos schell with /log:c:\result.txt

I opened another shell and the 2nd robocopy would not accept the /LOG:c:\result2.txt

had error invalid parameter /LOG

so I created a c:\temp directory and repeated the robocopy  with /LOG:c:\temp\result2

this time the robocopy completed.

Friday, April 24, 2009 4:07 PM by stephen kirby

# re: Another nasty Robocopy bug

Hi Stephen,

my best practise for using log together with robocopy is to use built-in variable %Random% to randomize log name:

Set LogName=Robocopy%Random%.log

Robocopy ... /LOG:C:\%LogName%

Optionally I use Type %LogName% >> Central.log afterwards...

Martin

Friday, April 24, 2009 4:52 PM by martin