当使用 robocopy 将目录树中的数据备份到 NAS 时,我不断收到错误 5 - 将 NTFS 安全性复制到目标目录。访问被拒绝。对于不应返回此类错误的文件夹。robocopy 脚本由名为“backup”的非管理员用户执行,该用户专门用于备份,拥有对所有文件和文件夹的完全访问权限。
执行脚本时,大多数文件夹返回错误 5,而其他一些文件夹返回错误 5。
日志如下:
-------------------------------------------------------------------------------
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
非常感谢您的帮助。
所涉及的所有文件和文件夹都允许执行脚本的备份用户完全访问。
我确信我遗漏了一些小事。
谢谢并期待您的帮助。
答案1
这通常是由于 RoboCopy 尝试备份文件的安全设置,并导致文件权限不匹配造成的。
如果您正在运行robocopy /copy:datsou
(复制所有属性)、robocopy /sec
(相当于/copy:dats
)或robocopy /copyall
(相当于/copy:datsou
),请尝试将其替换为robocopy /copy:dat
,这将忽略您正在复制的文件的 NTFS 访问控制列表(copy:s
参数)。当您明确不希望复制 NTFS ACL 时,这也很方便,例如在不同域之间复制文件时。
有关更多信息复制
答案2
我必须重新启动(或断开并重新连接?)客户端上的目标共享,我通过 yarcgui 调用了 robocopy。目标 smb/cifs 共享是 openindiana/solaris NAS,已成功加入 ws2012 ADDC。客户端是 Windows 10。所有人、域管理员和当前登录用户都可以完全访问该共享。