Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    Georgetown, MA, USA
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Strange Robocopy behavior

    I've been writing a backup script that uses Robocopy to do the actual backing up, and produces a full (not incremental) backup. The Robocopy switches I'm using (see attachment) are:

    /L List only - don’t copy, timestamp or delete any files (for debug only)
    /S Copy Subfolders. Not in argument list, added by Robocopy
    /E Copy Subfolders, including Empty Subfolders.
    /COPY:DATS What to COPY (D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs)
    /DCOPY:T Copy Directory Timestamps.
    /B Copy files in Backup mode.
    /R:0 Number of Retries on failed copies - default is 1 million.
    /W:30 Wait time between retries - default is 30 seconds. Added by Robocopy
    /LOG:FileName Write a log file
    /V Produce Verbose output log, showing skipped files


    When I attempt to back up C:\Users\Steve (my user tree) the log file captures some very strange behavior. A few branches are expanded recursively, extending the path each time by adding a repetition of the last folder name to the previous path. For example the files in

    c:\Users\Steve\AppData\Local\Application Data\

    would be copied; the next folder would be

    c:\Users\Steve\AppData\Local\Application Data\Application Data\


    and the same files are copied again. The next folder is

    c:\Users\Steve\AppData\Local\Application Data\Application Data\Application Data\

    and the same files are copied again. The process repeats until the path eventually becomes too long, whereupon Robocopy generates error 1921 "The name of the file cannot be resolved by the system" and moves on to the next folder. I've attached a brief clip from the beginning of the logfile to illustrate this remarkable behavior; note that as yet I have always run with the /L switch, so I have yet to copy any files - frankly, I'd like to understand what is going on a little better before I go live! Attempts to explore branches that show this error with Explorer are greeted with the "Access is denied" error.

    I'd be grateful for any and all insight into this strange behavior. I've just upgraded to 64 bit Win 7 Pro from XP, so please accept my apologies if I have overlooked something obvious. I'd also be grateful if you would overlook any idiosyncrasies in my formatting - this is my first post here, and I'm afraid it shows!

    Steve
    Attached Files Attached Files

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,855
    Thanks
    19
    Thanked 110 Times in 104 Posts
    In my case this was a symptom of having changed the permissions on the relevant Documents and Settings user (which no longer has real existance and is a Junction, kept for compatibility for old programs, and pointing to C:\users\<username>), probably in the early days when first Windows 7 was installed.

    I found it an absolute pig to recover from.

    But if this is a new install, and you haven't messed with permissions, might I suggest you try the switch /XJ - eXclude Junctions?
    BATcher

    Dear Diary, today the Hundred Years War started ...

  3. The Following 2 Users Say Thank You to BATcher For This Useful Post:

    scaisson (2012-08-09),Steve R (2012-08-08)

  4. #3
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,450
    Thanks
    14
    Thanked 251 Times in 199 Posts
    "Application Data" is a Junction Point to "AppData", and that is throwing Robocopy into a loop. BATcher's suggestion to use the /XJ switch would eliminate such loops.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  5. The Following 2 Users Say Thank You to bbearren For This Useful Post:

    scaisson (2012-08-09),Steve R (2012-08-08)

  6. #4
    New Lounger
    Join Date
    Dec 2009
    Location
    Georgetown, MA, USA
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you both very, very much. BATcher's suggestion of using the the /XJ switch solved the problem completely. Thank you also for pointing me in the direction of Junction Points, a concept that I had seen, but never comprehended. Your responses awakened a dim memory of the APPDATA environment variable; by entering "cd %APPDATA%" at a command prompt I was able to inspect the files and folders contained therein, and verify that they were included in the backup when the /XJ switch was used.

    Thanks again,

    Steve

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •