robocopy backup of important files


  1. Posts : 51
    Windows 10
       #1

    robocopy backup of important files


    hi,

    I have a standard Windows 10 build and I'm using robocopy to backup my data to an external drive. The goal is just to capture all my data so if the PC fails/gets stolen etc. I can restore my data on to another PC.

    I'm doing a backup of c:\users\ as this seems to capture all my data. Are there any other folders you think I should backup?

    I've excluded the 'AppData' folder as this seems to have a lot of stuff which is not data. Is that OK or do you think that should be backed up? Are there any other folders you think I should skip?

    Thank you very much for your comments.
      My Computer


  2. Posts : 8,057
    windows 10
       #2

    Welcome to the forum. Unless you have a lot of data putting everything on Google drive or ondrive is the best option there both free giving up to 20 gigs just save to that folder and it will sync on its own. A local hd is ok but if you have a fire, flood or robed its gone the cloud you can go anywhere in the world and get it and if you get a new pc it will all come back on its own without you doing anything. You can get a gui for robocopy now http://download.microsoft.com/downlo...ght2006_11.exe
      My Computer


  3. Posts : 31,474
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #3

    Long ago I wrote myself a batch file to automate using Robocopy to back up my data. Since my Windows 7 upgraded to Windows 10 I continue to use it. It's now quite sophisticated and accepts command line parameters for things like specifying the drive to back up to, the name of the backup directory to create and whether to do a full or incremental backup.

    At the heart of the full backup are the commands:
    attrib +A *.* /s
    robocopy . %MyBackupDrive%\Backups\%1_Full *.* /xjd /s /e /m /r:0
    Where:
    %mybackupdrive% is, by default the UNC path to a network drive, unless I specify another drive in the command line.

    %1 is the name of the backup, I use names of the form YYYY-MM-DD so I don't loose track (plus File Explorer's 'sort by name' puts them in date-order).

    /xjd
    is required to prevent infinite recursion of directories caused by junction points.
    http://www.sevenforums.com/general-d...sting-bug.html

    /r:0 prevents seemingly endless retries on any locked files.

    attrib +A *.* /s along with Robocopy ... /m is the key to doing incremental backups. First the archive attribute is set for al files, Then the full backup backs up all files which have their archive attribute set and clears it. For an incremental backup the attrib command is skipped so that only new/modified files will be copied (they're the only ones with an archive attribute) .

    As to what else to backup, well you may want to reconsider excluding all of AppData. Almost all your software keeps their configuration settings there. For instance, your Firefox profile, extensions and bookmarks are in: C:\Users\<username>\AppData\Roaming\Mozilla

    PS: for a 'belt and braces' approach, I also have my File History pointing to my network drive.

    You can never have enough backups.
      My Computers


  4. Posts : 51
    Windows 10
    Thread Starter
       #4

    thanks Samuria, the cloud suggestion was a good idea, however I have a lot of photos so for now I'll just back up to a hard drive which I keep at a remote location.

    Bree, thanks very much for your tips and suggestions.

    A friend suggested I use the mirror flag /mir do you know if there's any disadvantage to using that as opposed to using the attrib command? I think the mirror ensures that only recently changed files are copied.
      My Computer


  5. Posts : 31,474
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #5

    robocop said:
    A friend suggested I use the mirror flag /mir do you know if there's any disadvantage to using that as opposed to using the attrib command? I think the mirror ensures that only recently changed files are copied.
    I just used /m because in the early version of my batch file I had used Xcopy rather than RoboCopy - the /m switch works much the same in both, so it got carried over (I've used Xcopy since it was introduced in Dos 3.2, some 30 years ago). The mirror flag /mir should work just as well (if not better) but I haven't tried it (yet), so can't comment. Here's what the author of RoboCopy had to say about /mir ...
    https://blogs.technet.microsoft.com/...e-permissions/
      My Computers


  6. Posts : 51
    Windows 10
    Thread Starter
       #6

    Bree said:
    (I've used Xcopy since it was introduced in Dos 3.2, some 30 years ago).
    Thanks Bree, I used DOS that came with Windows 3.11 but I don't think that was version 3.2!
      My Computer


  7. Posts : 16,786
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    robocop said:
    the mirror flag /mir do you know if there's any disadvantage to using that as opposed to using the attrib command? I think the mirror ensures that only recently changed files are copied.
    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
      My Computer


  8. Posts : 51
    Windows 10
    Thread Starter
       #8

    Denis, thank you very much for the explanation. /mir is perfect for me. Cheers
      My Computer


 

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

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




Windows 10 Forums