2

I'm cloning a directory with robocopy. My intention is cloning everything, purging extra files in the destination and also overwriting files that are the same according to size and timestamp (/IS option)

My command is & ROBOCOPY $SourcePath $DestinationPath /MIR /IS /R:2 (I'm using PowerShell)

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : 
   Source : C:\A
     Dest : C:\B

    Files : *.*

  Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /IS /R:2 /W:30

------------------------------------------------------------------------------

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :        22         0         0         0         0         0
   Files :       234       232         2         0         0         0
   Bytes :   80.82 m   76.88 m    3.93 m         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : 

I don't understand why there are 2 skipped files - also I'm unable to find mention of this issue on the internet.

I'm launching this command in a remote PowerShell session. I'm not sure if it's relevant but this seem to happen especially in the remote session.

  • In the detailed output all but two files have status Same and no progress indicator.
  • Two files have status Older and the copy progress indication 0%-100%. So it seems only these two have been copied.

This is apparently the opposite of ROBOCOPY report above so I'm a bit confused.

Thank you very much for the help!

Zoran Jankov
  • 1
  • 2
  • 4
  • 17
smv
  • 125
  • 5
  • 1
    Running with `/v` will give a verbose list that includes the two skipped files. If no reason is listed for the skip, try to copy them manually to see if any error arrives. – harrymc Nov 05 '20 at 11:29
  • Thaks @harrymc. Running with /V shows two more files in the list with status modified that were not in previous list but no more info. – smv Nov 05 '20 at 11:51
  • What happens when copying them manually? – harrymc Nov 05 '20 at 11:52
  • If I log on the machine I can copy all the files manually without errors (of course I have to confirm overwriting). Robocopy also shows no error, retry or locked files at all. Just the list of files with the statuses and the puzzling (for me) final report – smv Nov 05 '20 at 13:07
  • The remote session might lack some permissions? – harrymc Nov 05 '20 at 13:21
  • I would exclude this - also no evidence of any permission error – smv Nov 05 '20 at 13:34
  • I've tried deleting the copied files and launching the copy - now all listed files have copy progress indicator NOT only the non "same" files. I really seems like /IS is ignored. Also If I launch the copy (with a non empty target folder) with or without /IS the summary is the same. – smv Nov 05 '20 at 13:47
  • @smv What's up, still having trouble with this, I have an idea that might help and I think it could be related to using the `/MIR` which; simply omit it. So I suggest you use a command something like this instead and then check your log file or output for that anomaly: `ROBOCOPY $SourcePath $DestinationPath "*.*" /S /E /PURGE /IS /ZB /R:2` – Vomit IT - Chunky Mess Style Nov 07 '20 at 16:24

1 Answers1

1

You also need to add /it option to include tweaked files.

smv
  • 125
  • 5
Zoran Jankov
  • 1
  • 2
  • 4
  • 17
  • Thanks, tweaked files were the issue but I was confused by robocopy report. For an explanation of how robocopy classifies files: https://superuser.com/questions/314503/what-does-robocopy-mean-by-tweaked-lonely-and-extra – smv Nov 12 '20 at 07:40
  • @smv You are welcome. You can also upvote the answer if you like it. – Zoran Jankov Nov 12 '20 at 08:24
  • @smv In [Microsoft Documentation](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy) they are called modified files. – Zoran Jankov Nov 12 '20 at 08:27