Robocopy Backup - ERROR 5 (0x00000005)

Page 1 of 2 12 LastLast

  1. Posts : 9
    Windows 7 Professional 64 bit
       #1

    Robocopy Backup - ERROR 5 (0x00000005)


    Hi,
    I'm wondering if anyone might be able to shed some light on why I am getting the following such errors when running a robocopy batch file (as administrator) which cause the backup script to stall (- albeit temporarily):

    2013/07/30 21:10:43 ERROR 5 (0x00000005) Copying File C:\Users\Tim\My Documents\Harey 8-128.jpg
    Access is denied.

    Waiting 30 seconds... Retrying...

    2013/07/30 21:12:20 ERROR 5 (0x00000005) Copying File C:\Users\Tim\My Documents\TimsData\Year1.pdf
    Access is denied.

    Waiting 30 seconds... Retrying...

    2013/07/30 21:15:27 ERROR 5 (0x00000005) Copying File C:\Users\Tim\My Documents\TimsData\Tim\Heddon's Mouth - Printable Walk - South West Coast Path.htm
    Access is denied.

    Waiting 30 seconds... Retrying...
    I am using the following backup command:

    Code:
    robocopy "%srcPath%\My Documents" "%dstPath%\My Documents" /b /v /ts /fp /bytes /tee /e /dcopy:t /copy:dt /a-:sh /xf desktop.* /np /log+:%logPath%\mwk1log.txt
    I realise that if I limit the retries and wait time from the defaults the stall time will be shortened and the file(s) skipped. However, that does not resolve the issue why robocopy is having a problem copying the file(s).

    I have found that if the erroring files are moved from the source location to the desktop, the following errors arethen recorded in the log:

    2013/07/30 21:11:13 ERROR 2 (0x00000002) Copying File C:\Users\Tim\My Documents\Harey 8-128.jpg
    The system cannot find the file specified.

    2013/07/30 21:13:53 ERROR 2 (0x00000002) Copying File C:\Users\Tim\My Documents\TimsData\Year1.pdf
    The system cannot find the file specified.

    2013/07/30 21:15:57 ERROR 2 (0x00000002) Copying File C:\Users\Tim\My Documents\TimsData\Tim\Heddon's Mouth - Printable Walk - South West Coast Path.htm
    The system cannot find the file specified.
    ... which is understandable as it has been moved. Then the backup script continues. But when I check the destination directory I find the file has been copied anyway!

    Additional Notes:
    The target device is an attached external USB drive.
    I have already checked that the permissions on the files/folders concerned are correct.
    The files affected appear to consistently be .jpg, .pdf or .htm files.
    The files do not appear to be corrupt as they can be opened and worked on as required.
    The batch file works fine apart from the intermittent errors copying files.

    Any advice would be greatly appreciated.
      My Computer


  2. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #2

    Hi,

    I have seen instances of a bug with the dcopy:t switch - try the script without that switch. You could also try the COPY:DATSOU switch, although I'm unclear if that copies the folder time stamps too.

    Code:
    robocopy "%srcPath%\My Documents" "%dstPath%\My Documents" /b /v /ts /fp /bytes /tee /e /copy:dt /a-:sh /xf desktop.* /np /log+:%logPath%\mwk1log.txt
      My Computer


  3. Posts : 9
    Windows 7 Professional 64 bit
    Thread Starter
       #3

    Hi Golden,

    Thank you for your feedback.
    I'm slightly confused by your reference to the dcopy:t switch, which I have not used.
    The switch I have used is the copy:dt switch. Did you mean that both switch forms are buggy and I should therefore try the copy:datsou switch?
      My Computer


  4. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #4

    If you check your script, you will see you did use that switch:

    robocopy "%srcPath%\My Documents" "%dstPath%\My Documents" /b /v /ts /fp /bytes /tee /e /dcopy:t /copy:dt /a-:sh /xf desktop.* /np /log+:%logPath%\mwk1log.txt

    Try running without it.
      My Computer


  5. Posts : 9
    Windows 7 Professional 64 bit
    Thread Starter
       #5

    Hi Golden,

    Doh! Apologies I must be going blind! I thought you'd quoted my code!
    I'll give that a try and come back to you.
    Thanks again.
      My Computer


  6. Posts : 9
    Windows 7 Professional 64 bit
    Thread Starter
       #6

    Hi Golden,

    Sorry about the delay in getting back to you.
    Unfortunately, removing the /dcopy:t switch made no difference. Exactly the same errors as before.
    I'll try the /copy:datsou switch instead of the /copy:dt switch as suggested and compare the logs.
    I'll keep you posted.

    Thanks for your patience. :)
    Last edited by ridgedale; 15 Aug 2013 at 15:59.
      My Computer


  7. Posts : 9
    Windows 7 Professional 64 bit
    Thread Starter
       #7

    Hi Golden,

    Finally, I've managed to get a comparison between the three slightly different scripts following your suggested changes.

    It appears the script fails identically with the inclusion of the /dcopy:t or /copy:datsou switches.
    With the /copy:dt switch it appears there are no more backup failures relating to .pdf files. Having said that none of the three revisions have produced an error free backup.

    This is all a bit of a mystery as a straight drag copy or copy and paste work without any hitch.

    If you have any further thoughts they would be most welcome.

    Thanks again and apologies for the delay in responding.
      My Computer


  8. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #8

    2013/07/30 21:12:20 ERROR 5 (0x00000005) Copying File C:\Users\Tim\My Documents\TimsData\Year1.pdf
    Access is denied.
    Mmm, I wonder if its the old "Library/junction point" problem.

    C:\Users\Tim\My Documents is actually C:\Users\Tim\Documents...............try it yourself : browse to \Users\Tim\My Documents in Windows Explorer....now highlight it in the address bar of Windows Explorer.

    Robocopy Backup - ERROR 5 (0x00000005)-ccc.png

    Edit the path in robocopy to read C:\Users\Tim\Documents........does the error still occur?
      My Computer


  9. Posts : 9
    Windows 7 Professional 64 bit
    Thread Starter
       #9

    Hi Golden,

    Unfortunately, that change made no difference either.
    I may well have to resort to script that does not use robocopy, if no solution can be found, which would be a shame given the logging detail the tool provides.

    Any further thought/suggestions would be very welcome.
    Thanks again.
      My Computer


  10. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #10

    Mmm, I'm not sure what else to try. Your errors only happen when you use "My Documents", and all the cases I have seen works when you replace that with just "Documents".

    See post #133,#134 and #135 here:
    ROBOCOPY - Create Backup Script

    The only thing I can think of is to check your script again, or backup all folders directly under /Tim.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:50.
Find Us