Robocopy Error 5

2

When using robocopy to backup data in a directory tree to a NAS, I keep getting Error 5 - Copying NTFS Security to Destination Directory. Access denied. for folders which shouldn't return such error. The robocopy script is executed by a non-admin user called "backup" used specifically for backups which has Full access to all files and folders.

When executing the script most of the folders return an erro 5 whilst some others return an error 5.

The log follows:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : 19 February 2017 17:01:15
   Source : F:\files\Archive\Dir1\Dir2\
     Dest : \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\

    Files : *.*

  Options : *.* /S /E /DCOPY:DA /COPY:DATS /PURGE /MIR /R:10 /W:5 

------------------------------------------------------------------------------

                       1    F:\files\Archive\Dir1\Dir2\
                       2    F:\files\Archive\Dir1\Dir2\01-11-2010\
2017/02/19 17:01:16 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\01-11-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\01_09_2010\
        Modified           62899    Production Hours + Progress 01-09-2010.xlsx
                       1    F:\files\Archive\Dir1\Dir2\02-11-2010\
2017/02/19 17:01:16 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\02-11-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\02_06_2010\
2017/02/19 17:01:16 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\02_06_2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\03-11-2010\
2017/02/19 17:01:17 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\03-11-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\03_06_2010\
                       3    F:\files\Archive\Dir1\Dir2\04_05_2010\
                       1    F:\files\Archive\Dir1\Dir2\06-10-2010\
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\06-10-2010\
Access is denied.


                       0    F:\files\Archive\Dir1\Dir2\07-08-10\
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\07-08-10\
Access is denied.


                       3    F:\files\Archive\Dir1\Dir2\08-07-10\
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\08-07-10\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\09-06-2010\
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\09-06-2010\
Access is denied.


                       5    F:\files\Archive\Dir1\Dir2\10_06_2010\
                       3    F:\files\Archive\Dir1\Dir2\12-10-2010\
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\12-10-2010\
Access is denied.


                       2    F:\files\Archive\Dir1\Dir2\13_05_2010\
                       1    F:\files\Archive\Dir1\Dir2\15-07-10\
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\15-07-10\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\15-09-2010\
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\15-09-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\17-08-10\
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\17-08-10\
Access is denied.


                       3    F:\files\Archive\Dir1\Dir2\17_06_2010\
2017/02/19 17:01:20 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\17_06_2010\
Access is denied.


                       2    F:\files\Archive\Dir1\Dir2\19-10-2010\
2017/02/19 17:01:20 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\19-10-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\20-10-2010\
2017/02/19 17:01:20 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\20-10-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\20_05_2010\
                       1    F:\files\Archive\Dir1\Dir2\21-07-10\
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\21-07-10\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\21-10-2010\
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\21-10-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\22-09-2010\
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\22-09-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\22-10-2010\
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\22-10-2010\
Access is denied.


                       2    F:\files\Archive\Dir1\Dir2\23_06_2010\
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\23_06_2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\25-10-2010\
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\25-10-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\27-10-2010\
2017/02/19 17:01:22 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\27-10-2010\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\27_05_2010\
                       1    F:\files\Archive\Dir1\Dir2\29-07-10\
2017/02/19 17:01:22 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\29-07-10\
Access is denied.


                       2    F:\files\Archive\Dir1\Dir2\29-09-10\
2017/02/19 17:01:23 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\29-09-10\
Access is denied.


                       2    F:\files\Archive\Dir1\Dir2\30-06-10\
2017/02/19 17:01:23 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\30-06-10\
Access is denied.


                       1    F:\files\Archive\Dir1\Dir2\Project Closure July 2010\
2017/02/19 17:01:23 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \\nas\fooBack\fooDrive\Auto2\Archive\Dir1\Dir2\Project Closure July 2010\
Access is denied.



------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :        34         0         0         0         0         0
   Files :        15         1        14         0         0         0
   Bytes :   907.4 k    61.4 k   846.0 k         0         0         0
   Times :   0:00:08   0:00:00                       0:00:00   0:00:07


   Speed :              511373 Bytes/sec.
   Speed :              29.261 MegaBytes/min.
   Ended : 19 February 2017 17:01:23

Help is greatly appreciated.

All files and folders involved allow Full access to the backup user executing the script.

I'm sure I'm missing something minor.

Thanks and I look forward to your help.

networking
security
backup
windows-server-2012
robocopy
asked on Server Fault Feb 19, 2017 by joebegborg07

2 Answers

1

That's usually caused by RoboCopy trying to backup the security settings for a file, and this causes some mismatch regarding the file permissions.

If you're running robocopy /copy:datsou (copies all attributes), robocopy /sec (equivalent to /copy:dats) or robocopy /copyall (equivalent to /copy:datsou), try replacing it by robocopy /copy:dat, which ignores the NTFS access control lists (the copy:s paramter) of the files you're copying. This is also handy when you explicitly don't want the NTFS ACLs to get copied, for example when replicating files between different domains.

More information regarding RoboCopy

answered on Server Fault Apr 5, 2020 by Stuggi
0

I had to reboot (or dis- and reconnect?) the target share on the client where I invoked robocopy by yarcgui. The target smb/cifs share was an openindiana/solaris NAS which joined successfully to the ws2012 ADDC. The client is windows 10. The share was fully accessible to everyone, domain-admins and the current logged in user.

answered on Server Fault Aug 8, 2017 by floogy • edited Aug 8, 2017 by floogy

User contributions licensed under CC BY-SA 3.0