New
#11
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:
The first command sets the Archive attribute for all files, /S does it for all subdirectories.Code:attrib +A *.* /s robocopy . <drive:\path> *.* /xjd /s /e /m /r:0
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./M :: copy only files with the Archive attribute and reset it.
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
Last edited by Bree; 25 Aug 2017 at 20:10. Reason: added more info
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 :)
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?
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)
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
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
Try:
UPDATE: If this does not work, then we need to create a script that does some magicCode:RD /S /Q U:\Backups\Hierarchies
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
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.