Solved

Robocopy keeps copying same folder over and over again

Posted on 2009-03-30
8
2,121 Views
Last Modified: 2012-05-06
I've recently started to use Robocopy for my daily backups.  It seems to work well but I have one issue.  It keeps copying the one folder over and over again.

I'm running Windows Vista and so far ever folder has copied with no problem except for the C:\Users folder.  I've tried to setup the batch file to copy the files and keep the same directory structure but it keeps copying a "Documents and Settings" folder with a subfolder for "All Users" which I don't even see as a valid folder on my PC (I am showing hidden files/folders).  To make matters worse, this folder apparently has some subfolders that it just keep copying over and over again, nesting them within themselves.

For instance, if the Users folder has subfolders called 1,2,3,4, and 5, then folders are created with those names but for some reason folder 5 gets new folders created for 1,2,3,4,5, then again #5 has them created, and again and again.  Maybe I'm just missing something but I can not figure this out!

My batch file line to kickoff the backup is as follows:

robocopy C:\ P:\%ComputerName%\  /S /COPY:DAT /XO /ZB /R:0 /W:0 /ETA /MON:5 /XA:STH

Can someone let me know what I'm doing wrong?  Thanks in advance for your help!
0
Comment
Question by:maianoel
  • 5
  • 2
8 Comments
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 100 total points
ID: 24020644
I had a problem similar to that.  The problem that "I" had was because somehow I had a shortcut in a folder that pointed to another folder in it's lineage.  So a shortcut to it's grandparent.  It would seem to get it stuck in a loop.
0
 

Author Comment

by:maianoel
ID: 24020682
Really... how were you able to locate the short cut and fix the issue?
0
 

Author Comment

by:maianoel
ID: 24020765
to make matters worse I've even looked through my C: drive and I don't even see a directory structure that matches what Robocopy is even backing up...
0
 
LVL 59

Accepted Solution

by:
LeeTutor earned 400 total points
ID: 24020842
The C:\Users\<useraccountname> folder has a number of symbolic links in it which you can only see when hiding files and folders is turned off in Folder Options. E.g., My Documents is a symbolic link to C:\Users\<account>\Documents. These symbolic links are there to make it easier for older programs written for XP able to work without having to be modified to reflect Vista's new folder structure. These are probably what are causing the problem. To see the symbolic links, go to the CMD prompt in the \Users\<useraccountname> folder and type DIR /AL
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:maianoel
ID: 24021032
great, thanks... and I'm sorry, now that I've done that what do I do about it?  I don't see anything listed which has a symbolic link referencing Documents and Settings.  Is there a way to fix the links or change the batch file to prevent this?
0
 
LVL 59

Expert Comment

by:LeeTutor
ID: 24021179
There is a Documents and Settings symbolic link in the C: root directory.  I'm not sure what you can do about it.
0
 

Author Closing Comment

by:maianoel
ID: 31564411
Thanks for pointing me in the right direction, guys... this really helped me solve my problem!
0
 

Author Comment

by:maianoel
ID: 24021533
Great, thanks guys, this really helped me.  Apparently if you add the /XJ switch it will exclude the junction points.  Once I did that my backup is now running like it should.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The main issue when installing Vista and XP in dual boot is when you have to reinstall any of the two when something fails, let's say a hard disk failure, a lost partition, virus, etc. What commonly happens is that you lose all your hard work config…
There are many reasons a PC runs slower than when it was new, ranging from malicious software intended to mess things up to simple general Windows use.  Your PC performance may slowly degrade over time without you noticing but when you buy a PC from…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now