windows - Why does Robocopy work once and then ignore all files the next time?

24
2014-04
  • Questioner

    I used the following command:

    Robocopy c:\source c:\backup /MIR /XD .svn
    

    Then I deleted c:\backup and did it once again. This time it ignored all files and copied nothing.
    Why is that?

    How do I force Robocopy to copy all the files again?

  • Answers
  • Diago

    I can only guess that the /MIR is assuming that the files are already there and not checking again. Maybe include the /FFT switch as well which uses timestamps for comparison and see if it makes a difference.

    Alternatively let robocopy log what it is doing. The log file may reveal why it is currently skipping files or folders. I would use the following for troubleshooting:

    Robocopy c:\source c:\backup /MIR /V /LOG:WhySkip.txt /XD .svn

    Added:
    /V - Verbose listing including skipped files
    /LOG:file - Log output to file


  • Related Question

    windows - command line remove read only flag on all subfolder entries or overwrite read only files with robocopy
  • Warszo.Sertz

    I need one of two things to work:

    1. I use robocopy to copy all sub-files and sub-folders from one folder to another, and the destination contains older files + files not in the source, and I need the files from the source to overwrite destination if present. The problem with this approach is read-only files.

      robocopy .... /E /NP /njh /njs /ndl /nc /ns /IA:R /IA:A /A-:R
      
    2. I might use the windows command attrib but that does not remove the read-only flag for sub-files.

      attrib -r <path-to-folder> /S /D
      

      I might use it without the last two arguments as well.

    Note: UAC is completely disabled and I am the owner of the files.

    I cannot use xcopy as that does not work in bjam for me, and I don't have all the paths for all the files: I only have parent source folder and parent destination folder. The hierarchy must remain.


  • Related Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.