Windows 10: robocopy /MIR deleted all my files in the destination folder..

Discus and support robocopy /MIR deleted all my files in the destination folder.. in Windows 10 Network and Sharing to solve the problem; ok so robocopy /MIR deleted all my files in the destination folder.. IT SHOULD HAVE AT LEAST A CONFIRMATION PROMPT BY DEFAULT !!!... Discussion in 'Windows 10 Network and Sharing' started by jaxx_rr, Sep 2, 2019.

  1. jaxx_rr Win User

    robocopy /MIR deleted all my files in the destination folder..


    ok so robocopy /MIR deleted all my files in the destination folder..
    IT SHOULD HAVE AT LEAST A CONFIRMATION PROMPT BY DEFAULT !!!

    :)
     
    jaxx_rr, Sep 2, 2019
    #1
  2. Roohi_Taj Win User

    Robocopy with /MIR fails with Recycle Bin error message

    Thank you for your response, Jim.

    Seems like you've done some great troubleshooting! Your approach towards sorting this issue out is much appreciated.



    We reproduced this issue on our systems with both Robocopy and Xcopy commands based on what you are trying to achieve. Using
    Robocopy with /Mir switch, all the files in the destination folder will be mirrored as in the source and the existing files in the destination will be deleted. The "mirror" switch keeps trees in sync by optionally deleting
    files out of the destination that are no longer present in the source. However, the same command without /Mir does not delete the destination files.

    With the Xcopy, you should be able to achieve the results that you are looking for and the files should be copied without any issues. Hence, I would recommend you to try the Xcopy command and let us know about the results. For more information on Xcopy refer
    the Microsoft article on
    xcopy
    .



    We await your response.



    Roohi Taj S

    Microsoft Community - Moderator
     
    Roohi_Taj, Sep 2, 2019
    #2
  3. Try3 Win User
    robocopy backup of important files


    Robocop,

    You are comparing chalk & cheese. The /mir switch has nothing to do with file attributes. The /m switch does. /mir Mirrors a directory tree
    /m Copies only files for which the Archive attribute is set, and resets the Archive attribute.
    Switches such as the /m switch operate on the source to select which files RoboCopy chooses to work with on that occasion.

    The /mir switch operates on the destination instead. It tells RoboCopy to update files on the destination from the source [where the source has newer ones] and to delete files on the destination that no longer exist in the source.

    So if you RoboCopy source files abcd then you will have abcd on the destination as well
    but if you later delete d from the source you will still have d on the destination.
    Results after next RoboCopy -
    d will stay on the destination if you RoboCopy with the /m switch
    d will be deleted from the destination if you RoboCopy with the /mir switch

    The /mir switch can be very useful.
    1 I use RoboCopy /mir as part of my backup regime. It creates a complete mirror image of all my files on the external HDD that I connect for that backup. If my computers ever failed or the place went up in flames then I could restore all my own folders & files just as they had been at the time the last RoboCopy was made.
    2 I also use RoboCopy /mir as part of my network syncing routine.

    Denis
     
    Try3, Sep 2, 2019
    #3
  4. Russm4226 Win User

    robocopy /MIR deleted all my files in the destination folder..

    When using RoboCopy in Windows 10, I sometimes get errors when I specify a LogFile and RoboCopy Aborts

    I use the following script for all of my RoboCopy functions, the only changes being made are to the SourceDrive, DestinationDrive and Folder variables.

    REM - Backup ProgramData to Drive N:

    REM ********* Set Source and Destination Drives **********

    SET SourceDrive=C:

    SET DestinationDrive=N:

    REM ******************************************************

    REM ***** Generate Source and Destination Folders ********

    SET Folder=ProgramData

    SET Source=%SourceDrive%\%Folder%

    SET Destination=%DestinationDrive%\%Folder%

    SET LogFile=/LOG:%Destination%\Xfer_%Folder%.log

    REM ******************************************************
    REM - Pause - Ready to backup %SourceDrive%\%Folder% Files to the N: Drive?

    robocopy "%Source%" "%Destination%" "%LogFile%" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    REM - robocopy "%Source%" "%Destination%" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    REM - notepad.exe %Destination%\Xfer_%Folder%.log

    Pause - Completed Backup

    It gets to the RoboCopy command: -

    C:\WINDOWS\system32>robocopy "C:\ProgramData" "N:\ProgramData" "/LOG:N:\ProgramData\Xfer_ProgramData.log" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    I then either reports the LogFile can't be found, or in this specific case displays: -

    Log File : N:\ProgramData\Xfer_ProgramData.log

    and freezes. CTRL+C has no effect.

    I have to close the CMD window

    When I REM out the first RoboCopy and enable the second one

    robocopy "%Source%" "%Destination%" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    RoboCopy will copy the files

    Any suggestions - 90% of my scripts work perfectly creating the xxx.log file!
     
    Russm4226, Sep 2, 2019
    #4
Thema:

robocopy /MIR deleted all my files in the destination folder..

Loading...
  1. robocopy /MIR deleted all my files in the destination folder.. - Similar Threads - robocopy MIR deleted

  2. destination folder

    in Windows 10 Gaming
    destination folder: i want to download a game. I dont know what destination folder i could use. https://answers.microsoft.com/en-us/windows/forum/all/destination-folder/8ca458d8-51fe-4f34-9f79-d78b1a677bad
  3. destination folder

    in Windows 10 Software and Apps
    destination folder: i want to download a game. I dont know what destination folder i could use. https://answers.microsoft.com/en-us/windows/forum/all/destination-folder/8ca458d8-51fe-4f34-9f79-d78b1a677bad
  4. Destination's Folder

    in Windows 10 Network and Sharing
    Destination's Folder: That it is full now and how does one empty it to allow backup space? https://answers.microsoft.com/en-us/windows/forum/all/destinations-folder/e67d4a5e-cda5-4b2a-af7d-fb0bd2d2afee
  5. Robocopy missing some files and folders

    in AntiVirus, Firewalls and System Security
    Robocopy missing some files and folders: We are planning to midgrade our fileserver from server 2012 R2 to 2019. When running robocopy to transfer files and fodders to 2012 R server to 2019, it shows no failed. However, if I check drive size and files copied on these two server, they are different.2012 R2 shows...
  6. ALL FILES in my user folder DELETED

    in Windows 10 Network and Sharing
    ALL FILES in my user folder DELETED: After I restarted my PC today, ALL files in my user folder are deleted, including pictures, videos, documents, desktop, music.... only the empty folder structure remains. The files are not moved to other folders on the C drive, I've looked for them. No new user profile were...
  7. ALL FILES AND FOLDERS DELETED

    in Windows 10 Network and Sharing
    ALL FILES AND FOLDERS DELETED: All my files and folders have been deleted on my PC and whenever I save a document, it gets deleted when I switch off the PC. Please help. https://answers.microsoft.com/en-us/windows/forum/all/all-files-and-folders-deleted/c18ae88f-af6d-4b28-a521-0f1168f0f6de"
  8. Robocopy with /MIR fails with Recycle Bin error message

    in Windows 10 Network and Sharing
    Robocopy with /MIR fails with Recycle Bin error message: I'm having issues completing my environment setup on my Dell XPS 8930 desktop computer. As mentioned in the subject line, my PC has both an SSD and HDD. The operating system (Windows 10 Pro) is on the SSD as Drive C. The HDD is 2tb and I plan to use this for my user data....
  9. Robocopy Destination Naming Confusion

    in Windows 10 Support
    Robocopy Destination Naming Confusion: My command is: Code: ROBOCOPY C:\Users\mikei\Documents J:\HP.Files /MIR /XD "C:\Users\mikei\Documents\FeedbackHub" "C:\Users\mikei\Documents\Cyberlink" /v /tee /ts /log:"I:\log.HP.temp.txt" [/quote] Have I made an error again? Earlier I tried to run a similar command as...
  10. All my folders and files are suddenly deleted

    in Windows 10 Support
    All my folders and files are suddenly deleted: Those files that got deleted were so important especially for my sister , please guys, help me , im literally crying for hours searching for the solution. I shutted down my laptop early this morning after installing programs (Utility Programs) which i know does not affect or...

Users found this page by searching for:

  1. robocopy mir deletes existing files