Page 2 of 3 FirstFirst 123 LastLast
  1.    25 Aug 2017 #11
    Join Date : Aug 2015
    Posts : 130
    Windows 10 x64 Pro
    Thread Starter

    Quote Originally Posted by Bree View Post
    I use RoboCopy in a batch file to backup my user folder. There's a couple of pitfalls to be aware of. You've already found the 'retries' one. The default is a million retries waiting 30 seconds between each (that's nearly a year!). NTUser.dat was the file that it caught me out on. There's some switches to deal with that...

    ...I skip locked files with /R:0 (which would probably have fixed your 'System Volume Information' problem too).

    The other problem I had was an infinite recursion (well, until the maximum path length was exceeded) of particular folders on the destination drive. These were caused by what look like links to 'My Music', 'My Pictures', etc. in the Documents folder. They're not links, they are Junction Points, there's a switch to deal with that too.


    Type RoboCopy /? for the full list.
    lol this may be helpful. Might be able to point me back to my original method. Nothing ventured nothing gained they say. If nothing else im learning and thats always a win when you have a terroristic toddler interrupting your "alone" time every 90 seconds ;p
      My ComputerSystem Spec
  2.    25 Aug 2017 #12
    Join Date : Aug 2016
    S/E England
    Posts : 4,520
    10 Home x64 (1709) (10 Pro on 2nd pc)

    If it helps, my batch files's commands for a full backup of all files and folders from the current location down (I'm in my user folder when I run it) are:

    Code:
    attrib +A *.* /s
    robocopy . <drive:\path> *.* /xjd /s /e /m /r:0
    The first command sets the Archive attribute for all files, /S does it for all subdirectories.
    For the RoboCopy command the . specifies the current directory as the source, the options I use mean:
    /M :: copy only files with the Archive attribute and reset it.
    /S :: copy Subdirectories, but not empty ones.
    /E :: copy subdirectories, including Empty ones.
    For subsequent incremental backups I omit the attrib command and the /e for robocopy so that only modified files (and the folders containing them) get copied.
    Last edited by Bree; 25 Aug 2017 at 20:10. Reason: added more info
      My ComputersSystem Spec
  3.    26 Aug 2017 #13
    Join Date : Aug 2015
    Posts : 130
    Windows 10 x64 Pro
    Thread Starter

    Quote Originally Posted by Bree View Post
    If it helps, my batch files's commands for a full backup of all files and folders from the current location down (I'm in my user folder when I run it) are:

    Code:
    attrib +A *.* /s
    robocopy . <drive:\path> *.* /xjd /s /e /m /r:0
    The first command sets the Archive attribute for all files, /S does it for all subdirectories.
    For the RoboCopy command the . specifies the current directory as the source, the options I use mean:

    For subsequent incremental backups I omit the attrib command and the /e for robocopy so that only modified files (and the folders containing them) get copied.
    thank you again for the reply

    what does the archive attribute accomplish/do?

    In the end, what worked for me - or at least got me past the specific issue i was having (thus far) was doing the following

    robocopy U:\ C:\Users\klepp\Desktop\U /e /xf * /a-:sh /xd "System Volume Information"

    even with excluding the SVI directory the folder kept disappearing in its entirety. I had to add the remove hidden attribute and now it works fine. (added the -s switch as a "just in case" considering the reasons im using it at current i imagine it has a much higher potential to cause an issue than help anything)

    Now to try and get all folders im copying into a batch and try out this /xo thing. In the future, perhaps start adding files instead of folder heirarchy.

    Seriously glad I got to learn a little somethin somethin
      My ComputerSystem Spec
  4.    26 Aug 2017 #14
    Join Date : Aug 2015
    Posts : 130
    Windows 10 x64 Pro
    Thread Starter

    I knew id be back. Sigh.

    Ok heres where I'm at lol.

    I'm trying to now find a way to copy all my drives heirarchies individually to my flash drive one at a time. Started with the least destrructive as i mentioned before which IS my flash drive. This is the same folder which works fine if I copy it to desktop.

    Using this robocopy U:\ U:\Backups\Hierarchies\U\ /e /xf * /a-:sh /xo /xd "System Volume Information"

    It works until it gets to the Hierarchies folder then it repeats itself over n over /BackupsHierarchies/Backups/Hierarchies on and on and on.

    Any ideas whats going on?
      My ComputerSystem Spec
  5.    26 Aug 2017 #15
    Join Date : Jan 2017
    Turku
    Posts : 1,781
    Windows 10 Pro IP Build 16299.19 (Branch: RS3 Release)

    Archive Attribute is a switch that gets turned on each time a file is modified or created. This switch is useful for RoboCopy as you can turn the switch off with RoboCopy for each file that RoboCopy has successfully backed up.

    What Bree does, is that for initial FULL backup, he turns this attribute on for ALL his files. When RoboCopy copies the files to the backup location, it in turn turns off this switch for each and every file. Finally when Bree wants to make an incremental backup, only files that has been modified(Windows automatically turns the switch back on for modified files) will be backed up, thus saving a lot of space.

    When he wants to restore the backup, he would start by restoring the original full copy, and then process each incremental backup in order, until all backups are restored. (this is if he want to keep historical copies also of modified files, meaning he creates a new base folder each time he makes a new incremental backup)
      My ComputersSystem Spec
  6.    26 Aug 2017 #16
    Join Date : Jan 2017
    Turku
    Posts : 1,781
    Windows 10 Pro IP Build 16299.19 (Branch: RS3 Release)

    Quote Originally Posted by klepp0906 View Post
    I knew id be back. Sigh.

    Ok heres where I'm at lol.

    I'm trying to now find a way to copy all my drives heirarchies individually to my flash drive one at a time. Started with the least destrructive as i mentioned before which IS my flash drive. This is the same folder which works fine if I copy it to desktop.

    Using this robocopy U:\ U:\Backups\Hierarchies\U\ /e /xf * /a-:sh /xo /xd "System Volume Information"

    It works until it gets to the Hierarchies folder then it repeats itself over n over /BackupsHierarchies/Backups/Hierarchies on and on and on.

    Any ideas whats going on?
    Yes, you must exclude the path "U:\Backup" from your robocopy command when copying within same drive.

    Why do you need to make directory structure also of system and hidden files, like "System Volume Information"? directories and files in SVI has no useful information for you at all.
      My ComputersSystem Spec
  7.    26 Aug 2017 #17
    Join Date : Aug 2015
    Posts : 130
    Windows 10 x64 Pro
    Thread Starter

    cant win. seeems it created a backups/hierarchies repeitition so deep, i cant even delete the file from my USB stick.

    unmounted it, moved it to the different port, tried taking ownership... nothing works.

    I right click delete, and nothing happens. No error/popup/nothing. I imagine its due to the unimaginably long directory structure. I let it run for ~5mins before i realized what it was doing/stopping it so has to be hundreds of repeititions deep.

    The usb stick has over 100gb on it so formatting isnt really an option. FML! :P
      My ComputerSystem Spec
  8.    26 Aug 2017 #18
    Join Date : Aug 2015
    Posts : 130
    Windows 10 x64 Pro
    Thread Starter

    Quote Originally Posted by slicendice View Post
    Yes, you must exclude the path "U:\Backup" from your robocopy command when copying within same drive.

    Why do you need to make directory structure also of system and hidden files, like "System Volume Information"? directories and files in SVI has no useful information for you at all.
    I dont need to, i need to omit it. It was giving me issues. the /xd System Volume Information seems to not copy it, otherwise it was copying it by default.

    Also thank you for the clarification on Bree's method. I'll probably work up to that point as theres only so much that the cloud/syncing method covers and thats also not infallable. Like they always say, back up to several places which is what im attempting to do at the most rudamentary level atm.

    the /xd U:\Backup makestotal sense. Gaurantee that fixes my issue Thank you!
    Just hav eto figure out how to get rid of the infinate backup/hierarchy folder that exists atm now :P lol
      My ComputerSystem Spec
  9.    26 Aug 2017 #19
    Join Date : Jan 2017
    Turku
    Posts : 1,781
    Windows 10 Pro IP Build 16299.19 (Branch: RS3 Release)

    Try:

    Code:
    RD /S /Q U:\Backups\Hierarchies
    UPDATE: If this does not work, then we need to create a script that does some magic

    UPDATE: smartdelete.zip contains a batch file that will remove the endless directory structure in your case. Extract the containing batch file to U:\Backups and run it. This batch will remove any existing Backups, U and Hierarchies folders that exist in the folder the script is run in.

    HERE IS THE CODE
    Code:
    @echo off
    :start_process
    IF EXIST Hierarchies (
    IF EXIST Hierarchies\U (
    RENAME Hierarchies\U x
    MOVE Hierarchies\x . > nul
    RD /S /Q Hierarchies
    RENAME x U
    GOTO :start_process
    )
    RD /S /Q Hierarchies
    GOTO :process_done
    )
    
    IF EXIST U (
    IF EXIST U\Backups (
    RENAME U\Backups x
    MOVE U\x . > nul
    RD /S /Q U
    RENAME x Backups
    GOTO :start_process
    )
    RD /S /Q U
    GOTO :process_done
    )
    
    IF EXIST Backups (
    IF EXIST Backups\Hierarchies (
    RENAME Backups\Hierarchies x
    MOVE Backups\x . > nul
    RD /S /Q Backups
    RENAME x Hierarchies
    GOTO :start_process
    )
    RD /S /Q Backups
    GOTO :process_done
    )
    
    :process_done
    echo.
    echo All Directories removed SUCCESSFULLY!
    GOTO :eof
    Last edited by slicendice; 26 Aug 2017 at 11:28. Reason: Updated the script
      My ComputersSystem Spec
  10.    26 Aug 2017 #20
    Join Date : Aug 2015
    Posts : 130
    Windows 10 x64 Pro
    Thread Starter

    Quote Originally Posted by slicendice View Post
    Try:

    Code:
    RD /S /Q U:\Backups\Hierarchies
    UPDATE: If this does not work, then we need to create a script that does some magic
    C:\Windows\system32>RD /S /Q U:\Backups\HierarchiesU:\Backups\Hierarchies\editedforfoulnameirenamedfolderinattempttodelete\Backups\Hierarchies\U\Backups\Hierarchies\U\Backups\Hierarchies\U\Backups\Hierarchies\U\Backups\Hie rarchies\U\Backups\Hierarchies\U\Backups\Hierarchies\U\Backups\Hierarchies\U\Backups\Hierarchies\U\B ackups\Hierarchies - The system cannot find the path specified.

    Yes its renameable and has a size of 0 aka just folders. Thank you very much for your help as this seems above my pay grade for sure. Have never ran into this before. Permissions issues, sure.. but this is just odd and rarely encountered id bet.
      My ComputerSystem Spec

 
Page 2 of 3 FirstFirst 123 LastLast


Similar Threads
Thread Forum
Using RoboCopy
I'm trying to use RoboCopy to backup my data files to a USB stick and External HDD. I created a folder in each destination called DataBackup and run the following command. robocopy "d:\datafiles" "e:\databackup /e Problem is it doesn't copy...
General Support
Need some critique on my backup plans using robocopy
I am trying to make better file backups. So in order to have different backup frequencies on different files, I decided to write scripts to run robocopy to perform the backups (I'm running these scripts manually using scheduler to display...
Backup and Restore
Need some help from someone familair with dropbox and symlinks
Ugh! Im at wits end here lol. All these years later i finally jump on the cloud storage bandwagon and nobody offers placeholders and syncing outside the client folder is rare at best. we're forced to use workarounds such as symlinks and while I...
Network and Sharing
2 odd issues - anyone familair w/ the inner workings able to help?
So heres the deal. after reformatting my entire PC due to a networking issue - ive gotten it ALMOST back to where I want it. I'll be the first to admit ive disabled a couple services, and ive removed all the microsoft bloatwares. That being...
Software and Apps
Robocopy and /ETA switch
I have a few batch scripts to backup or restore files, and for some of them, I have the /ETA switch in them as they will move some larger files. In W7, It would always give the time to transfer, but in Win10 (x64), this switch doesn't seem to do...
General Support
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 06:33.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums