locked
Strange Robocopy results... RRS feed

  • Question

  • This is not, strictly speaking, a script question, but rather more about the results of a robocopy command.  If this is not the right place to ask, please tell me where is better.

    In the process of migrating from Server 2008R2 to Server 2019 I issued the following commands.  Once for moving Server2008\d:\ and once for server2008\h: to DC201\d:.

    ROBOCOPY SOURCE: DESTINATION: /E /SECFIX /SEC /XO /XJ /ZB /COPYALL /DCOPY:T /R:0 /W:0 /TEE /LOG:"C:\RCLOGX.LOG" /MT:32

    The syntax here is slightly more complicated than what I am used to, in particular the /XO parameter.  On the weekend I ran the identical robocopy a second time thinking it would update for any changes that users had made  since the first time as I have always done in the past so that the last minute copy would be faster.   But in fact what happened is the target was stripped of most, if not all, of the previously copied files and I had to start over.

    What explains that command removing files previously copied with the same command?

    Thanks for your help, either in explaining or pointing me to another place to ask.


    • Moved by Bill_Stewart Tuesday, October 13, 2020 9:38 PM Off-topic
    Sunday, October 4, 2020 1:13 AM

All replies

  • Correct.  You are in the wrong forum.  Please post in the Windows General forum for help using system utility programs.

    RoboCopy does NOT remove files.


    \_(ツ)_/

    Sunday, October 4, 2020 3:48 AM
  • Thanks for the pointer.  However, I landed here _because_ I posted in a Windows General forum and was instructed to post here.  

    I guess there is no hope.

    And in spite of your comment that RC does not remove files, it most certainly did.  However I mis-typed the command that was issued.  Here is the actual command.

    Robocopy Source Target /E /SECFIX /SEC /XO /XJ /ZB /COPYALL /MIR /DCOPY:T /R:0 /W:0 /TEE /LOG:"C:\RCLOGX.log"

    I suspect now it was the addition of /mir on subsequent passes that caused the removal since all the files present on the target are not present on source A nor on source B as they are different file sets.  Puzzling though as the first pass on source B (run after the first past on source A) should have removed files from the target that were not present on that source.

    If true, then as always the devil is in the details.

    Sunday, October 4, 2020 10:33 AM
  • Hi,

    As jrv mentioned, the Windows Server forum is the correct forums to ask about Robocopy, also be aware that the Windows Server forums have been migrated to the new Microsoft Q&A platform.

    You'll find the General Windows Server forum over here:
    https://docs.microsoft.com/en-us/answers/topics/windows-server.html

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Sunday, October 4, 2020 3:48 PM