Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robocopy command is not copying files and folders [closed]

Im attempting the simplest use of robocopy with powershell:

robocopy C:\Users\tkeen\Documents\test\ C:\Users\tkeen\Documents\test2\

It doesn't seem to do anything. This is the response I get back:

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

  Started : Friday, April 22, 2022 5:51:41 PM
   Source : C:\Users\tkeen\Documents\test\
     Dest : C:\Users\tkeen\Documents\test2\

    Files : *.*

  Options : *.* /DCOPY:DA /COPY:DAT /R:1000000 /W:30

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

                           0    C:\Users\tkeen\Documents\test\

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

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : Friday, April 22, 2022 5:51:41 PM

I tried with other options like \MIR but then I just get a "ERROR : Invalid Parameter #3 : \mir" message. Not sure what Im doing wrong.

like image 823
Tyler Avatar asked Oct 28 '25 04:10

Tyler


1 Answers

Try Below

robocopy "Source" "destination" /MIR /E /XO /xx /tee /R:2 /W:1 /SEC /LOG:"o/p path"
  • MIR - mirrors directory - deletes files which is present in destination but not in source
  • E - copies subdirectories even folder is empty
  • X0 - excludes older files - we can say for incremental
  • xx - excludes extra files - will not delete extra files in destination (XX overtakes MIR)
  • tee - gives output in command prompt also
  • R - Number of Retries on failure
  • W - Wait time between Retries
  • SEC - copy with security
  • LOG - output path
like image 145
NK149 Avatar answered Oct 29 '25 21:10

NK149



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!