Robocopy Question about /MIR option RRS feed

  • Question

  • I am experimenting with Robocopy and have created the following command.  My intent is to backup my Desktop, Documents, Pictures, Music and videos and exclude everything else.  I use the /MIR option as I want my backup to match exactly what is on my hard drive (if I delete a file from my hard drive it gets deleted from my backup).  The command does exactly this when run.  My question is this...  After running he command, say I wish to now exclude the Videos folder from the backup.  I add another line:

    /XD "c:users\Owner\Videos ^

    to the command and run it again.  Now that the Videos folder has been excluded, I would expect that the Videos folder already stored on the destination drive would be deleted due to the /MIR option.  This is not the case.  The Videos folder still exists on the destination drive.  Why is this?

    If I format the destination drive and run the command again, the Videos folder is excluded.  Just wondering why it doesn't get deleted upon running without formatting the destination first.

    Thank you for your time!

    Robocopy C:\Users\Owner D:\MyBackup ^
    /XD "c:\users\Owner\AppData" ^
    /XD "c:\users\Owner\MicrosoftEdgeBackups" ^
    /XD "c:\users\Owner\3D Objects" ^
    /XD "c:\users\Owner\Searches" ^
    /XD "c:\users\Owner\Saved Games" ^
    /XD "c:\users\Owner\Links" ^
    /XD "c:\users\Owner\Favorites" ^
    /XD "c:\users\Owner\OneDrive" ^
    /XD "c:\users\Owner\Dropbox" ^
    /XD "c:\users\Owner\Contacts" ^
    /MIR /XA:SH /XJD /R:5 /W:15 /V /TEE /log:D:\backup.txt

    • Moved by Bill_Stewart Thursday, January 3, 2019 3:57 PM This is not robocopy support forum
    Sunday, November 4, 2018 10:31 PM

All replies

  • This is not a RoboCopy forum.  This is a scripting forum.  RC is not a script.

    Post in the Windows General forum for end user help with RoboCopy or post here: http://answers.microsoft.com


    Sunday, November 4, 2018 10:38 PM