Robocopy Error - Access Denied

Posted on 2011-04-29
Last Modified: 2012-05-11
Last week I wrote a simple Robocopy script and saved it as Robo3.cmd on my Windows 2003 Ent server. The script is intended to copy the Backup Exec Exchange and bkf files to an attached 2TB USB for off site backup. It worked perfect for three days running as a scheduled Windows task using the domain administrator login and pw for credentials.

Yesterday, I decided to make a master copy of the backup files and replaced the USB drive with a fresh duplicate drive formated as NTFS like the others. After 5 hours of copying files,  it copied the recycle bin and tried copying the System Volume Information which started a continious loop of errors every 30 seconds. How do I stop the recycle bin and System Volume Information from being copied?

Here is that portion of the log file.

        New Dir          0      f:\RECYCLER\
        New Dir          4      f:\RECYCLER\S-1-5-21-1278163717-1751908949-1237765062-500\
          New File                    65      desktop.ini
          New File                 1.3 g      Df5.bkf
          New File                 1.3 g      Df6.bkf
          New File                  4820      INFO2
                         1      f:\System Volume Information\  
2011/04/28 16:30:41 ERROR 5 (0x00000005) Copying File f:\System Volume Information\MountPointManagerRemoteDatabase
Access is denied.

Waiting 30 seconds... Retrying...
Question by:Tony Giangreco
    LVL 82

    Accepted Solution

    /XD "F:\Recycler" "F:\System Volume Information"
    to your command line.
    In addition, you can set /r (retry) and /w (wait between retries) both to 0, since this is a local copy and unlikely to have recoverable errors:
    /r:0 /w:0
    LVL 25

    Author Comment

    by:Tony Giangreco
    Ok, that worked, but the external USB drive ran out of space before the process could complete. How do i tell Robocopy to stop if it runs out of space?

    Here is my script

    ### Capture date info
    echo %date:~-4,4%
    echo %date:~-7,2%
    echo %date:~-10,2%
    set yr=%date:~-4,4%
    set mo=%date:~-7,2%
    set dy=date:~-10,2%
    set f2=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%
    robocopy.exe f:\ x:\ *.* /E /SEC /NP /COPYALL /XD "F:\Recycler" "F:\System Volume Information" /Log:%fn%
    copy %fn% Robo-Today.txt
    LVL 82

    Expert Comment

    There's no provision for that. Either leave it running until it has come by the last source file, or kill the process (Ctrl-C in the command prompt).

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    I know all systems administrator at some time or another has had to create a script to copy file from a server share to a desktop. Well now there is an easy way to do this in Group Policy. Using Group policy preferences is not hard. The first thing …
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    732 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

    22 Experts available now in Live!

    Get 1:1 Help Now