ROBOCOPY - Create Backup Script

Page 15 of 32 FirstFirst ... 5131415161725 ... LastLast

  1. Posts : 1
    Win 7 x64
       #140

    How to use ROBOCOPY AFTER manually backing up


    Hello,

    Great thread on robocopy.

    I have a NAS and manually copied over the files. I now want to use robocopy.

    I am wary of using robocopy as my backup tool as I have some thoughts which may cause issues:

    1) The datetime on the folders and files on the NAS are when I did the manual copy, not the source attributes, and so if I use the robocopy /MIR I am not sure what will happen.

    How should I sync the NAS folder/files attributes back to the source with robocopy so I can use /MIR successfully?

    Basically asking what should be the steps if a person used to copy folders manually and NOW wants to use robocopy? You guide seems to be for first time use and some points on how to transition from a manual process would be great.

    2) Also, I have a number of source folders from many machines which I copy to ONE folder on the NAS. That is, all sub folders from multiple sources go to ONE folder on the NAS, which essentially is all the source sub folders under one folder on the NAS.

    I want to be able to mirror the source locations to a "merged" single destination folder and only copy over changes.

    Is that possible with robocopy?

    Thanks!
      My Computer


  2. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #141

    Hi,

    I'm not sure what would happen transitioning from manual copy to robocopy - all I can suggest is to setup a simple test case and experiment with that.

    For the merged location, you can do that. This is what I have:

    Code:
    robocopy E:\Music G:\General_Backup\Music /e /mir /mt:8 /R:3 /W:3
    robocopy E:\Photo's G:\General_Backup\Photo's /e /mir /mt:8 /R:3 /W:3
    robocopy F:\Keys G:\General_Backup\Keys /e /mir /mt:8 /R:3 /W:3
    Again, its best to put a small test case together and check how it works.

    Regards,
    Golden
      My Computer


  3. Posts : 26
    Windows 10 Home, 64-bit
       #142

    /MIR is perfectly safe, does not delete files from source


    Golden said:
    Warning
    Use the /MIR option with caution - it has the ability to delete a file from both the source and destination under certain conditions.

    This typically occurs if a file/folder in the destination has been deleted, causing ROBOCOPY to mirror the source to the destination. The result is that the same files in the source folder are also deleted. To avoid this situation, never delete any files/folders from the destination - delete them from the source, and then run the backup to mirror the destination to the source.

    If in doubt, do not use the /MIR option, but be aware that backups will take longer.
    For benefit of anyone following this tutorial: this section is incorrect. I checked with knowledgeable MS sources, and I and others tested this extensively.

    /MIR is perfectly safe to use. /MIR does not delete files from source, ever. Even if you manually delete files from destination, /MIR will not delete files from source.

    In fact, the only time Robocopy deletes files from source is if you use the /MOV option to move files, (which deletes from source after copying).

    Please correct this otherwise good tutorial to remove the false warning about the useful /MIR option.
    Last edited by giuopli; 04 Nov 2012 at 15:56.
      My Computer


  4. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #143

    If you type robocopy /? at a command prompt you will see that:

    /mir is the same as performing /purge and /e

    Have a look at what the /purge option does.
      My Computer


  5. Posts : 26
    Windows 10 Home, 64-bit
       #144

    I'm well aware that /MIR = /PURGE + /E. That will never delete files from source.

    Microsoft Technet said:
    /PURGE : Deletes destination files and directories that no longer exist in the source.
    That means that Robocopy will delete files from destination, if you have deleted them from source.

    Neither /PURGE nor /MIR will delete files from source. Please test it, you'll see.
      My Computer


  6. Posts : 881
    Windows 7 Ultimate x64
       #145

    Great write up robocopy is pretty powerful.
      My Computer


  7. Posts : 8
    Windows 7 professional 64-bit
       #146

    First, congrats and thanks for the good article!
    Now let’s get to my problem.
    I tried to set up a back up strategy. When I tried the syntax directly in CMD there is no problem, and the files are copied properly. But when I try to set up a .bat file, the program does not run (it starts, but it does not finish, nor initialize). The file is located on my desktop.
    I’ve attached a picture of cmd when I start the robo.bat file.

    Here is the syntax:
    robocopy d:\diploma d:\programi\dropbox\diploma /s /np /tee /log:d:\diploma\robo.txt
    pause

    What am I doing wrong?

    Thanks
    Attached Thumbnails Attached Thumbnails ROBOCOPY - Create Backup Script-robocopy.jpg  
      My Computer


  8. Posts : 26
    Windows 10 Home, 64-bit
       #147

    Try running the .bat as Administrator (a right-click command).
      My Computer


  9. Posts : 8
    Windows 7 professional 64-bit
       #148

    Already tried, same result…
      My Computer


  10. Posts : 26
    Windows 10 Home, 64-bit
       #149

    Are you able to run other .bat files from that location? (e.g. .bat files that aren't running Robocopy?)
      My Computer


 
Page 15 of 32 FirstFirst ... 5131415161725 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:21.
Find Us