Robocopy mass nesting bug

BunBun

New member
Local time
1:45 PM
Messages
136
Didn't know where else to put this so I hope this is good.

Twice now I have experienced a issue with robocopy where while copying a user folder it mass nests the Application Data folder within Local. It replicates this to both \User\AppData\Local and \User\Local Settings. Weird thing is Local Settings is just a place holder to point legacy programs to the new location so why robo copy created a folder from this I am not to sure. Both times I have had this happen it has replicated the Application Data folder so many times within itself that it fills the HDD down to the last byte. And since it is nesting it the path is far too long for any standard windows command to do anything with this structure. For example my last instance of it replicated about 15,000 files into over 200,000 from ~9GB to over 80GB and over 30 directories deep. Not sure if there is any end to it or if it does just keep repeating until the drive is full. Some loop issue with the local settings place holder?

Anyway to delete this massively nested directory structure I have found two methods.

1. Boot into Ubuntu (or any distro of your chooseing... I like the Ubuntu live CD) and delete the folder from there. In Ubuntu it moves into the trash so you have to delete it from there as well.

2. Use robocopy again to copy over a nul directory. For instance I created a empty folder called empty on the root of C and then as follows ROBOCOPY C:\EMPTY "X:\USERS\ADMINISTRATOR\APPDATA\LOCAL\APPLICATION DATA" /NOCOPY /PURGE which then deletes all extra files that are in the directory that are not in empty. Works very quickly and effectively.

Before discovering the last technicque I formatted my drive the last time to correct this issue as the drive was empty anyway.

To prevent this from happening again I temporarily moved the local settings place holder out of the source directory and created the files local settings and application data with no extensions in there appropriate places to prevent robocopy from creating those directories in the first place. However while watching I didn't even see it attempt to do this (would have seen a cannot write destination or some error to that extent) so it seems removing the local settings place holder corrected it.

Just thought I would share and see if anyone could give some insight into this issue/bug.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64QX6700 @ 3.2Ghz (temporarily till I get the d...8gb (4x2gb) OCZ PC2-8500GTX280
Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ultimate x64
CPU
QX6700 @ 3.2Ghz (temporarily till I get the drive to tweak)
Motherboard
Asus Maximus Formula
Memory
8gb (4x2gb) OCZ PC2-8500
Graphics Card(s)
GTX280
Sound Card
Auzentech Prelude
Monitor(s) Displays
Samsung 244T & 940BF
Screen Resolution
1920x1200 & 1280x1024
Hard Drives
2 x Hitatchi 7K500 500GB in raid 0
PSU
Seasonic M-12 700w
Case
Lian Li PC-6077B
Cooling
Liquid (D-tek Fuzion 2/DDC+/240GTX)
Keyboard
Saitech Eclipse II
Mouse
Logitech G9
Internet Speed
22Mbit burst - 15 Mbit typical down / 500Kbit up
Other Info
http://pics.livejournal.com/bun_bun/pic/001c64ww
This sounds as though it could have something to do with junctions. Have you tried the command with the /XJ switch? You might need to use /XJD (Directory) or /XJF (File) switch instead. This switch tells Robocopy to ignore or eXclude the specified type of Junction point. These are included by default.
 

My Computer My Computer

At a glance

Windows 8.1 Pro RTM x64Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Brid...4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2...MSI GeForce GTX770 Gaming OC 2GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
This sounds as though it could have something to do with junctions. Have you tried the command with the /XJ switch? You might need to use /XJD (Directory) or /XJF (File) switch instead. This switch tells Robocopy to ignore or eXclude the specified type of Junction point. These are included by default.

What I was thinking was that everytime it got to the Local Settings thing it would loop back and then nest since the directory already existed...

I will look into junctions and try those switches. Thanks.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64QX6700 @ 3.2Ghz (temporarily till I get the d...8gb (4x2gb) OCZ PC2-8500GTX280
Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ultimate x64
CPU
QX6700 @ 3.2Ghz (temporarily till I get the drive to tweak)
Motherboard
Asus Maximus Formula
Memory
8gb (4x2gb) OCZ PC2-8500
Graphics Card(s)
GTX280
Sound Card
Auzentech Prelude
Monitor(s) Displays
Samsung 244T & 940BF
Screen Resolution
1920x1200 & 1280x1024
Hard Drives
2 x Hitatchi 7K500 500GB in raid 0
PSU
Seasonic M-12 700w
Case
Lian Li PC-6077B
Cooling
Liquid (D-tek Fuzion 2/DDC+/240GTX)
Keyboard
Saitech Eclipse II
Mouse
Logitech G9
Internet Speed
22Mbit burst - 15 Mbit typical down / 500Kbit up
Other Info
http://pics.livejournal.com/bun_bun/pic/001c64ww
Hey Guys,

Thanks for posting that response Dwarf. I was having a problem trying to use robocopy to backup C:\users\profilename\documents using the /MIR switch to a backup disk as it was getting an access denied trying to get to MY Music and such.

What I find funny is robocopy /? says that /XJ (normally included by default). I thought that meant that it was the default behavior, but

robocopy C:\users\profilename\Documents D:\backup\Document /MIR (fails)

robocopy C:\users\profilename\Documents D:\backup\Document /MIR /XJ (works)

Wierd
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Q9550 2.83Ghz OC'd to 3.40Ghz8GB G.Skill PI DDR2-800, 4-4-4-12 timingsEVGA 1280MB Nvidia GeForce GTX570
Computer Manufacturer/Model Number
Self-Built in July 2009
OS
Windows 7 Ultimate x64
CPU
Intel Q9550 2.83Ghz OC'd to 3.40Ghz
Motherboard
Gigabyte GA-EP45-UD3R rev. 1.1, F12 BIOS
Memory
8GB G.Skill PI DDR2-800, 4-4-4-12 timings
Graphics Card(s)
EVGA 1280MB Nvidia GeForce GTX570
Sound Card
Realtek ALC899A 8 channel onboard audio
Monitor(s) Displays
23" Acer x233H
Screen Resolution
1920x1080
Hard Drives
Intel X25-M 80GB Gen 2 SSD
Western Digital 1TB Caviar Black, 32MB cache. WD1001FALS
PSU
Corsair 620HX modular
Case
Antec P182
Cooling
stock
Keyboard
ABS M1 Mechanical
Mouse
Logitech G9 Laser Mouse
Internet Speed
15/2 cable modem
Other Info
Windows and Linux enthusiast. Logitech G35 Headset.
You have interpretted it wrongly. What it means is that adding the switch /XJ (or one of the alternatives) means that the relevant type of Junction will be eXcluded. By default, i.e. without the switch, all junctions are included.
 

My Computer My Computer

At a glance

Windows 8.1 Pro RTM x64Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Brid...4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2...MSI GeForce GTX770 Gaming OC 2GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Yes, after testing it and reading it again...i get it. Thanks again.....It resolved my issue where I used a handful of /XD switches on my backup command.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Q9550 2.83Ghz OC'd to 3.40Ghz8GB G.Skill PI DDR2-800, 4-4-4-12 timingsEVGA 1280MB Nvidia GeForce GTX570
Computer Manufacturer/Model Number
Self-Built in July 2009
OS
Windows 7 Ultimate x64
CPU
Intel Q9550 2.83Ghz OC'd to 3.40Ghz
Motherboard
Gigabyte GA-EP45-UD3R rev. 1.1, F12 BIOS
Memory
8GB G.Skill PI DDR2-800, 4-4-4-12 timings
Graphics Card(s)
EVGA 1280MB Nvidia GeForce GTX570
Sound Card
Realtek ALC899A 8 channel onboard audio
Monitor(s) Displays
23" Acer x233H
Screen Resolution
1920x1080
Hard Drives
Intel X25-M 80GB Gen 2 SSD
Western Digital 1TB Caviar Black, 32MB cache. WD1001FALS
PSU
Corsair 620HX modular
Case
Antec P182
Cooling
stock
Keyboard
ABS M1 Mechanical
Mouse
Logitech G9 Laser Mouse
Internet Speed
15/2 cable modem
Other Info
Windows and Linux enthusiast. Logitech G35 Headset.
You're welcome. :)
 

My Computer My Computer

At a glance

Windows 8.1 Pro RTM x64Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Brid...4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2...MSI GeForce GTX770 Gaming OC 2GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
To further explain this, let's use an illustrative example.

<Directory>
File#1
File#2
<Junction> (points to <Directory> i.e. <Junction> resolves to <Directory>)
File#3
File#4

Executing the command without the /XJ switch (i.e. the default) gives the following result:

<Directory>
File#1
File#2
<Directory> (redirected from <Junction>)
File#1
File#2
<Directory>
File#1
File#2
etc

As you can see, when a Junction is encountered, it is resolved and the program continues from the location where the Junction is referencing. This creates an endless loop.

Now with the /XJ switch:

<Directory>
File#1
File#2
(the switch /XJ tells the program to skip <Junction>)
File#3
File#4
end

Here the /XJ switch is specified. As a result, Junctions are ignored and not resolved. The program simply skips over them and continues from the next location.
 

My Computer My Computer

At a glance

Windows 8.1 Pro RTM x64Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Brid...4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2...MSI GeForce GTX770 Gaming OC 2GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Incidentally, there is not a bug in Robocopy. Robocopy was included in earlier versions of Windows prior to the introduction of Junctions. Instead of rewriting the routine, the developers added code to detect the use of the /XJ and associated switches. This resulted in the default behaviour that we have seen described here.
 

My Computer My Computer

At a glance

Windows 8.1 Pro RTM x64Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Brid...4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2...MSI GeForce GTX770 Gaming OC 2GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Sorta of a bug as it was not originally intended to operate like that. The bug has a fix which is not common knowledge... but then again neither is robocopy really so :)

I could have sworn I have done this before without issue though...

Thank you for the information.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64QX6700 @ 3.2Ghz (temporarily till I get the d...8gb (4x2gb) OCZ PC2-8500GTX280
Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ultimate x64
CPU
QX6700 @ 3.2Ghz (temporarily till I get the drive to tweak)
Motherboard
Asus Maximus Formula
Memory
8gb (4x2gb) OCZ PC2-8500
Graphics Card(s)
GTX280
Sound Card
Auzentech Prelude
Monitor(s) Displays
Samsung 244T & 940BF
Screen Resolution
1920x1200 & 1280x1024
Hard Drives
2 x Hitatchi 7K500 500GB in raid 0
PSU
Seasonic M-12 700w
Case
Lian Li PC-6077B
Cooling
Liquid (D-tek Fuzion 2/DDC+/240GTX)
Keyboard
Saitech Eclipse II
Mouse
Logitech G9
Internet Speed
22Mbit burst - 15 Mbit typical down / 500Kbit up
Other Info
http://pics.livejournal.com/bun_bun/pic/001c64ww
What a Relief!

Thanks BunBun. Your No.2 did the trick to rid me of a huge "Empty" Local folder on my backup external usb drive. It took 10 minutes to purge, but appears to have worked. I even deleted the Applications Data folder ahead of it.

The primary motivator was that Panda had found 8 copies of Trj/CI.A trojan in that folder. This all started when I accepted "help" from a presumed SME when my system kept locking up. He ragged on Vista long enough he convinced me to upgrade to 7. During total backup I even mentioned to him an apparent syntax error comparing two of his CMD lines when he had Remote Access of my system and was using Robocopy, which may have caused the famous recursion infinite loop issue. I've been combing a ton of googles and found several claimed fixes for this exact problem.

However, yours is the first-only approach and instruction I've come across that appeared well enough explained for me to attempt.

Thanks again.
 

Attachments

  • Success Delete -Empty- Folder.JPG
    Success Delete -Empty- Folder.JPG
    82 KB · Views: 59

My Computer My Computer

At a glance

7 HomePrem x64, fresh install using DVD along...Quad Core i3, with new thermo paste overheati...4GB
Computer type
Laptop
Computer Manufacturer/Model Number
2012 Samsung R580 15"
OS
7 HomePrem x64, fresh install using DVD along w/ new Hard drive
CPU
Quad Core i3, with new thermo paste overheating repair
Memory
4GB
Hard Drives
500GB Sata, installed replacement Toshiba in Mar '18
Internet Speed
300Mb
Antivirus
Defender, MS Essentials
Browser
Firefox
Other Info
Been dealing with computers since '88 and my first XT w/ the HUGE optional 10Mb hard drive. I STILL know next to nothing about them.
Back
Top