Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Robocopy Backup - ERROR 5 (0x00000005)


30 Jul 2013   #1

Windows 7 Professional 64 bit
 
 
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):

Quote:
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:

Quote:
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 System SpecsSystem Spec
.

04 Aug 2013   #2

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
04 Aug 2013   #3

Windows 7 Professional 64 bit
 
 

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 System SpecsSystem Spec
.


07 Aug 2013   #4

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
07 Aug 2013   #5

Windows 7 Professional 64 bit
 
 

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 System SpecsSystem Spec
10 Aug 2013   #6

Windows 7 Professional 64 bit
 
 

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.
My System SpecsSystem Spec
15 Aug 2013   #7

Windows 7 Professional 64 bit
 
 

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 System SpecsSystem Spec
16 Aug 2013   #8

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

Quote:
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.

Name:  ccc.png
Views: 4
Size:  47.8 KB

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


My System SpecsSystem Spec
19 Aug 2013   #9

Windows 7 Professional 64 bit
 
 

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 System SpecsSystem Spec
19 Aug 2013   #10

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
Reply

 Robocopy Backup - ERROR 5 (0x00000005)




Thread Tools



Similar help and support threads for2: Robocopy Backup - ERROR 5 (0x00000005)
Thread Forum
ROBOCOPY - Create Backup Script Tutorials
Want XCOPY, not ROBOCOPY! File creation error Backup and Restore
Users unable to access deployed printers, error 0x00000005 Network & Sharing
Robocopy - Access denied Error 5 Real Directory Backup and Restore
Robocopy backup for personal folders Backup and Restore
Robocopy backup - file permissions General Discussion
Anyone use robocopy to backup? Backup and Restore

Our Sites

Site Links

About Us

Find 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 07:37 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33