- Remove From My Forums
-
Question
-
Hi all,
Is it possible to let a non administrator made copies of a folder template with permissions?
The non admin user is using:
robocopy «source» «destination»
/e /copy:DATSCopying job will proceed until half the process is done and stopped with the message below:
ERROR 5 (0x00000005) Creating Destination Directory XXXXXXX
Access is denied.
and it will continuously wait for 30 seconds but couldn’t get the rest of the folders copied over.
I couldn’t figure why the first half of the folder with NTFS permissions copied successfully but the rest couldn’t.
Please help, thank you.
Answers
-
Hi,
I performed similar tests in my lab just now and received the same errors, here is my conclusion:
If the user who is running the robocopy (non-administrator) has Modify permissions on the destination folder, the permissions of the source folder & files will not be copied, the error appears.
If the user who is running the robocopy (non-administrator) has Modify + special permission (Change permission), the permissions of the source folder & files will be copied, but I still received these errors although all files and folders and permissions
were successfully copied.Best regards,
Leon
Blog:
https://thesystemcenterblog.com
LinkedIn:
Tried this, it is successfully copied over but do not retain NTFS permission settings.
You need to make sure you have the appropriate permissions (sufficient permissions) on both the source and the destination, I performed multiple tests and noticed clear differences.
My tests were performed on the Windows Server 2016/2019 operating system.
Blog:
https://thesystemcenterblog.com
LinkedIn:-
Marked as answer by
Thursday, April 11, 2019 6:23 AM
-
Marked as answer by
-
Hi,
Thanks for your reply!
please check if your colleague’s account has the change permission on both the source and target folder.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.-
Marked as answer by
pglost
Thursday, April 11, 2019 6:24 AM
-
Marked as answer by
-
Yes it worked out finally. It was a source and target folder permission issue.
Apparently both folders has to be under ‘Full Control’ for the nonadmin, and furthermore there were some child folders that has it’s own permissions that were not assigned to the nonadmin, causing the errors.
-
Marked as answer by
pglost
Thursday, April 11, 2019 6:24 AM
-
Marked as answer by
Симптомы
Рассмотрим следующий сценарий:
-
Добавить учетную запись пользователя группе операторов архива домена или локальной группы «Операторы архива».
-
Эта учетная запись используется для входа на компьютер под управлением Windows 7 или Windows Server 2008 R2.
-
Используйте команду Robocopy с параметром /B скопировать некоторые файлы, не имеют разрешения на доступ или владельца.
В этом случае эти файлы будут скопированы успешно. Тем не менее их данные конфигурации безопасности, такие как список управления доступом (ACL) не копируется. Вместо этого эти файлы наследуют их ACL из конечной папки.
Кроме того утилиту Robocopy.exe возвращает одно из следующих сообщений об ошибке:
-
Ошибка 5 (0x00000005), копирование безопасности NTFS для конечного каталога < имя каталога > доступ запрещен -
Ошибка 5 (0x00000005), копирование безопасности NTFS для конечного файла< имя каталога > доступ запрещен
Следует иметь в виду при запуске программы Robocopy.exe с параметром /B для копирования файла является членом группы «Операторы архива», все, что должен быть скопирован. Член должен иметь доступ к сведениям о конфигурации безопасности файла, даже если член не имеет разрешений для файла или владельца файла.
Причина
Эта проблема возникает, так как программа Robocopy.exe не открыть эти файлы с помощью флага «цель резервного копирования», если используется параметр /B . Это предотвращает доступ к сведения о конфигурации безопасности для пользователя, имеющего «Резервного копирования файлов и каталогов» прав (SE_BACKUP_PRIVILEGE).
Примечание. Если файл открыт с помощью флага «цель резервного копирования», проверяются определенные права доступа, и пользователю, открывшему файл предоставляется соответствующий доступ к файлу.
Решение
Сведения об исправлении
Существует исправление от корпорации Майкрософт. Однако данное исправление предназначено для устранения только проблемы, описанной в этой статье. Применяйте это исправление только в тех случаях, когда наблюдается проблема, описанная в данной статье. Это исправление может проходить дополнительное тестирование. Таким образом если вы не подвержены серьезно этой проблеме, рекомендуется дождаться следующего пакета обновления, содержащего это исправление.
Если исправление доступно для скачивания, имеется раздел «Пакет исправлений доступен для скачивания» в верхней части этой статьи базы знаний. Если этот раздел не отображается, обратитесь в службу поддержки для получения исправления.
Примечание. Если наблюдаются другие проблемы или необходимо устранить неполадки, вам может понадобиться создать отдельный запрос на обслуживание. Стандартная оплата за поддержку будет взиматься только за дополнительные вопросы и проблемы, которые не соответствуют требованиям конкретного исправления. Чтобы получить полный список телефонов поддержки и обслуживания клиентов корпорации Майкрософт или создать отдельный запрос на обслуживание, посетите следующий веб-сайт корпорации Майкрософт:
http://support.microsoft.com/contactus/?ws=supportПримечание. В форме «Пакет исправлений доступен для скачивания» отображаются языки, для которых доступно исправление. Если нужный язык не отображается, значит исправление для данного языка отсутствует.
Предварительные условия
Для установки этого исправления на компьютере должна быть установлена Windows Server 2008 R2 или Windows 7.
Необходимость перезагрузки
Необходимо перезагрузить компьютер после установки данного исправления.
Сведения о замене исправлений
Это исправление не заменяет ранее выпущенные исправления.
Сведения о файлах
Английский (США) версия данного исправления устанавливает файлы с атрибутами, указанными в приведенных ниже таблицах. Дата и время для файлов указаны в формате UTC. Дата и время для файлов на локальном компьютере отображаются в местном времени с вашим текущим смещением летнего времени (DST). Кроме того, при выполнении определенных операций с файлами, даты и время могут изменяться.
Примечания к сведениям о файлах Windows 7 и Windows Server 2008 R2
Важно. Исправления для Windows Server 2008 R2 и Windows 7 включены в одни и те же пакеты. Однако исправления на странице запроса исправлений перечислены под обеими операционными системами. Чтобы запросить пакет исправления, который применяется к одной или обеим ОС, установите исправление, описанное в разделе «Windows 7/Windows Server 2008 R2» страницы. Всегда смотрите раздел «Информация в данной статье относится к следующим продуктам» статьи для определения фактических операционных систем, к которым применяется каждое исправление.
-
Файлы MANIFEST (.manifest) и MUM (.mum), устанавливаемые для каждой среды, указаны отдельно в разделе «Сведения о дополнительных файлах для Windows Server 2008 R2 и Windows 7». Файлы MUM и MANIFEST, а также связанные файлы каталога безопасности (CAT) чрезвычайно важны для поддержания состояния обновленных компонентов. Файлы каталога безопасности, для которых не перечислены атрибуты, подписаны цифровой подписью корпорации Майкрософт.
Для всех поддерживаемых 86-разрядных версий Windows 7
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
---|---|---|---|---|---|
Robocopy.exe |
5.1.10.1027 |
98,816 |
19-Feb-2010 |
07:55 |
x86 |
Для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
---|---|---|---|---|---|
Robocopy.exe |
5.1.10.1027 |
128,000 |
19-Feb-2010 |
08:02 |
x64 |
Robocopy.exe |
5.1.10.1027 |
98,816 |
19-Feb-2010 |
07:55 |
x86 |
Для всех поддерживаемых версий Windows Server 2008 R2 для систем на базе процессоров IA-64
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
---|---|---|---|---|---|
Robocopy.exe |
5.1.10.1027 |
265,216 |
19-Feb-2010 |
06:34 |
IA-64 |
Robocopy.exe |
5.1.10.1027 |
98,816 |
19-Feb-2010 |
07:55 |
x86 |
Статус
Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».
Дополнительные сведения
Для получения дополнительных сведений о терминологии обновлений программного обеспечения щелкните следующий номер статьи базы знаний Майкрософт:
Описание 824684 Стандартные термины, используемые при описании обновлений программных продуктов Майкрософт
Для получения дополнительных сведений щелкните следующий номер статьи базы знаний Майкрософт:
973776 сведения о конфигурации безопасности, такие как ACL, не копируются, если оператор архива не использует утилиту Robocopy.exe с параметром /B для копирования файла на компьютере под управлением Windows Vista или Windows Server 2008
Сведения о дополнительных файлах
Сведения о дополнительных файлах для Windows 7 и Windows Server 2008 R2
Дополнительные файлы для всех поддерживаемых версий Windows 7 для систем на базе x86
Имя файла |
Update.mum |
Версия файла |
Неприменимо |
Размер файла |
1,674 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
X86_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_9cf47061efb3ad1e.manifest |
Версия файла |
Неприменимо |
Размер файла |
696 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest |
Версия файла |
Неприменимо |
Размер файла |
2,586 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
08:24 |
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых версий Windows Server 2008 R2 с архитектурой IA-64
Имя файла |
Ia64_558f690380b00de69835c91def69e446_31bf3856ad364e35_6.1.7600.20648_none_6b75fb69a08aba9d.manifest |
Версия файла |
Неприменимо |
Размер файла |
698 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
Ia64_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_9cf61457efb1b61a.manifest |
Версия файла |
Неприменимо |
Размер файла |
697 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
Ia64_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c7970abf66b0517f.manifest |
Версия файла |
Неприменимо |
Размер файла |
2,588 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
09:25 |
Платформа |
Неприменимо |
Имя файла |
Update.mum |
Версия файла |
Неприменимо |
Размер файла |
1,684 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest |
Версия файла |
Неприменимо |
Размер файла |
2,586 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
08:24 |
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2
Имя файла |
Amd64_289a23833955983618528339f2d450e2_31bf3856ad364e35_6.1.7600.20648_none_b09b47b22cf89dfe.manifest |
Версия файла |
Неприменимо |
Размер файла |
700 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
Amd64_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_f9130be5a8111e54.manifest |
Версия файла |
Неприменимо |
Размер файла |
698 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
Amd64_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_23b4024d1f0fb9b9.manifest |
Версия файла |
Неприменимо |
Размер файла |
2,590 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
09:31 |
Платформа |
Неприменимо |
Имя файла |
Update.mum |
Версия файла |
Неприменимо |
Размер файла |
2,328 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
10:58 |
Платформа |
Неприменимо |
Имя файла |
X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest |
Версия файла |
Неприменимо |
Размер файла |
2,586 |
Дата (UTC) |
19-Feb-2010 |
Время (UTC) |
08:24 |
Платформа |
Неприменимо |
Нужна дополнительная помощь?
I am getting the above error while I am using robocopy command. I have given all possible permissions on both source and destination folders but still I am getting this error. Any idea how to fix this.
asked Jul 18, 2011 at 11:58
Is this to and from ntfs partitions?
If you are coping to FAT of EXT then add the /FFT parameter to assume FAT file times (2 second granularity) ext2/ext3 also uses 2 second granularity.
You could also try using the /COPY:DT parameter, by default robocopy copies the data, attributes and timestamp /COPY:DT will skip the attributes.
Also check your share permissions as well as your ntfs permissions
answered Jul 18, 2011 at 12:06
2
For me it worked fine when I ran the command directly on the server, but when I ran it from PowerShell remoting I would get this error. I was also trying to copy files from the local machine to a network share. The fix for me was to use:
Invoke-Command -ComputerName $sourceServer -Credential $credential -Authentication Credssp -ScriptBlock {
& RoboCopy "C:Source" "\OtherServerC$Destination" /E
}
Specifically, using -Credential $credential -Authentication Credssp
fixed the issue for me.
You didn’t provide enough info to know if this is the same issue you were having, but thought I’d mention it for others who encounter the same error message.
answered Jan 4, 2021 at 23:51
deadlydogdeadlydog
21.8k14 gold badges106 silver badges117 bronze badges
As part of the annual EPM DR Rehearsal, we got a requirement to move Prod Application backup files from PROD Network location to DR network path.
In this post, we will see how we can RoboCopy EPM backup files from one Network location to another network path.
Why ROBOCOPY?
If you are copying files from one network path to another and you have Windows Vista or later operating systems then Robocopy is a better choice than any other option. Because you don’t need to bother with drive mappings, since it handles UNC paths just fine.
Robocopy is not a third party software. It’s native (built-in) to all versions of Windows Vista and later.
It is usually far more reliable than xcopy command, and provides a lot more options.
Robocopy is tolerant of interrupts during copying i.e. it can pick up where it left off if it gets stopped for some reason. It has the ability to recover from certain types of network hiccups automatically.
Read Link1 and Link2 for more details about ROBOCOPY and its various options.
Script using ROBOCOPY to copy EPM backups from PROD to DR network path:
@echo off
for /f «delims=» %%a in (‘wmic OS Get localdatetime ^| find «.»‘) do set «dt=%%a»
::Format the WMIC command output in DDMMYYYY format
set «YY=%dt:~0,4%»
set «MM=%dt:~4,2%»
set «DD=%dt:~6,2%»
set «today_date=%DD%%MM%%YY%»
::Define Source path
set sourcepath1=\PROD_Network_SharedataEPM_Backups%today_date%
set sourcepath2=\PROD_Network_SharedataEPM_BackupsDataZip
set sourcepath3=\PROD_Network_SharedataEPM_BackupsScripts
::Define Destination path
set destinationpath1=\DR_Network_SharedataEPM_Backups_Copy%today_date%
set destinationpath2=\DR_Network_SharedataEPM_Backups_CopyDataZipCopy
set destinationpath3=\DR_Network_SharedataEPM_Backups_CopyScriptsCopy%today_date%
::Define Log path
set logfile=E:AdminProd_To_DR_Copy.log
::Run RoboCopy commands
REM Copy all the files, folders and sub-folders from source to destination
robocopy %sourcepath1% %destinationpath1% /E /COPY:DAT /NP /LOG+:»%logfile%»
REM Copy today’sdate(DDMMYY).zip file from source to destination
robocopy %sourcepath2% %destinationpath2% %today_date%.zip /COPY:DAT /NP /LOG+:»%logfile%»
REM Copy all the files with extensions .sh, .mxl, .ksh, .scr from source to destination
robocopy %sourcepath3% %destinationpath3% *.sh *.mxl *.ksh *.scr /COPY:DAT /NP /LOG+:»%logfile%»
Below is what each ROBOCOPY command options used above means:
- /E = Copy files including subfolders (even empty ones)
- /COPY:copyflag[s] = what to COPY for files. Here we have selected DAT: D=Data, A=Attributes, T=Timestamps
- /NP = No Progress — don’t display % copied text in logfile; this keeps filesize down.
- /LOG+:logfile = Output status to LOG file (+= append to existing log).
ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory. Access denied
When I was trying to figure out the right set of options for ROBOCOPY command, I encountered this error multiple times.
This error is usually caused by RoboCopy trying to copy the security settings of the files, and this causes some mismatch regarding the file permissions.
There is a /B switch in RoboCopy for copying in backup mode but Backup mode cannot circumvent explicit NTFS deny ACL’s if the copier isn’t the objects’ owner.
Solution: Use /COPY:DAT only
Option /COPY:copyflag[s] can take multiple values based on what you want to copy for files. To Copy ALL file info (equivalent to /COPY:DATSOU), there is an option /COPYALL.
To overcome the above-mentioned error, you should use /COPY:DAT instead of the /COPYALL option, because /COPY:DAT ignores the NTFS access control lists (the COPY:S parameter) of the files you’re copying.
This works because /COPYALL is equivalent to /COPY:DATSOU, D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info, U=aUditing info. While we mainly need Data and Timestamps of the files for EPM backups.
That’s all for this post.
I hope this article has helped you.
Your suggestions/feedback are most welcome.
Keep learning and Have a great day!!!
Содержание
- Getting ERROR 5 (0x00000005) Creating Destination Directory while using robocopy to copy files
- 2 Answers 2
- Related
- Hot Network Questions
- Subscribe to RSS
- SOLVED Robocopy error 5 access is denied
- arkoMax
- Artion
- arkoMax
- anodos
- Robocopy error 5 0x00000005 creating destination directory
- Answered by:
- Question
- Answers
- Robocopy error 5 0x00000005 creating destination directory
- Answered by:
- Question
- Answers
- Robocopy error 5 0x00000005 creating destination directory
- Asked by:
- Question
- All replies
Getting ERROR 5 (0x00000005) Creating Destination Directory while using robocopy to copy files
I am getting the above error while I am using robocopy command. I have given all possible permissions on both source and destination folders but still I am getting this error. Any idea how to fix this.
2 Answers 2
Is this to and from ntfs partitions?
If you are coping to FAT of EXT then add the /FFT parameter to assume FAT file times (2 second granularity) ext2/ext3 also uses 2 second granularity.
You could also try using the /COPY:DT parameter, by default robocopy copies the data, attributes and timestamp /COPY:DT will skip the attributes.
Also check your share permissions as well as your ntfs permissions
For me it worked fine when I ran the command directly on the server, but when I ran it from PowerShell remoting I would get this error. I was also trying to copy files from the local machine to a network share. The fix for me was to use:
Specifically, using -Credential $credential -Authentication Credssp fixed the issue for me.
You didn’t provide enough info to know if this is the same issue you were having, but thought I’d mention it for others who encounter the same error message.
Hot Network Questions
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2022 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2022.11.3.43004
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
SOLVED Robocopy error 5 access is denied
arkoMax
Dabbler
Hello,
I am trying to update directory/file timestamps using robocopy from my PC (Win7) but get an error «ERROR 5 (0x00000005) Time-Stamping Destination Directory. Access is denied».
The command I am using is:
robocopy source destination /e /COPY:DT /DCOPY:T /TIMFIX /FFT
The dataset owner, and user logged on to the PC, are the same. The dataset is mapped as a drive through an SMB share, and I have no problem copying/deleting content on the share. The security properties under win explorer show full access. This seems to be similar to the problem @Cosmo_Kramer was having here, but I have no idea what that fix does or how to implement it.
The output of getfacl of the share (getfacl /mnt/VOL1/media) is:
Artion
Patron
arkoMax
Dabbler
Thanks, I looked at those pages, but to be honest I don’t quite understand them. I am technical, but only in the windows world . I have no unix/linux experience and don’t really want to go punching commands into the CLI only presuming what will happen.
Any chance you could give me a bit more direct instructions?
anodos
Sambassador
Why do you need /TIMFIX? Are you trying to robocopy a directory or an entire user profile?
One thing to bear in mind though is that by default FreeNAS has the samba parameter nfs4:mode = special set. When you viewed your permissions from the CLI, you had
These are special access control entries that are in the NFSv4 spec for compatibility with traditional posix mode bits (permissions). They behave differently than what you’d typically experience in windows. The closest approximation is «CREATOR OWNER» and «CREATOR OWNER-GROUP», which is (to simplify things) how they appear when nfs4:mode = simple .
I think the best way to work around this is to set a new inheriting ACE at the root of your share for the group that you’re using to robocopy files. You can do this through File Explorer. (You can do the user, but I prefer to manage permissions through groups.)
Источник
Robocopy error 5 0x00000005 creating destination directory
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
Is it possible to let a non administrator made copies of a folder template with permissions?
The non admin user is using:
robocopy «source» » destination » /e /copy:DATS
Copying job will proceed until half the process is done and stopped with the message below:
ERROR 5 (0x00000005) Creating Destination Directory XXXXXXX
Access is denied.
and it will continuously wait for 30 seconds but couldn’t get the rest of the folders copied over.
I couldn’t figure why the first half of the folder with NTFS permissions copied successfully but the rest couldn’t.
Please help, thank you.
Answers
I performed similar tests in my lab just now and received the same errors, here is my conclusion:
If the user who is running the robocopy (non-administrator) has Modify permissions on the destination folder, the permissions of the source folder & files will not be copied, the error appears.
If the user who is running the robocopy (non-administrator) has Modify + special permission (Change permission), the permissions of the source folder & files will be copied, but I still received these errors although all files and folders and permissions were successfully copied.
Best regards,
Leon
Blog: https://thesystemcenterblog.com LinkedIn:
Tried this, it is successfully copied over but do not retain NTFS permission settings.
You need to make sure you have the appropriate permissions (sufficient permissions) on both the source and the destination, I performed multiple tests and noticed clear differences.
My tests were performed on the Windows Server 2016/2019 operating system.
Blog: https://thesystemcenterblog.com LinkedIn:
Источник
Robocopy error 5 0x00000005 creating destination directory
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
Is it possible to let a non administrator made copies of a folder template with permissions?
The non admin user is using:
robocopy «source» » destination » /e /copy:DATS
Copying job will proceed until half the process is done and stopped with the message below:
ERROR 5 (0x00000005) Creating Destination Directory XXXXXXX
Access is denied.
and it will continuously wait for 30 seconds but couldn’t get the rest of the folders copied over.
I couldn’t figure why the first half of the folder with NTFS permissions copied successfully but the rest couldn’t.
Please help, thank you.
Answers
I performed similar tests in my lab just now and received the same errors, here is my conclusion:
If the user who is running the robocopy (non-administrator) has Modify permissions on the destination folder, the permissions of the source folder & files will not be copied, the error appears.
If the user who is running the robocopy (non-administrator) has Modify + special permission (Change permission), the permissions of the source folder & files will be copied, but I still received these errors although all files and folders and permissions were successfully copied.
Best regards,
Leon
Blog: https://thesystemcenterblog.com LinkedIn:
Tried this, it is successfully copied over but do not retain NTFS permission settings.
You need to make sure you have the appropriate permissions (sufficient permissions) on both the source and the destination, I performed multiple tests and noticed clear differences.
My tests were performed on the Windows Server 2016/2019 operating system.
Blog: https://thesystemcenterblog.com LinkedIn:
Источник
Robocopy error 5 0x00000005 creating destination directory
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
When i run robocopy i got below error. But i can see the pdf in that folder?
Robocopy \server1HR \server2HR /XF thumbs.db *.tmp /XD DfsrPrivate /E /SEC /MOT:120 /XO /B /FFT /r:2 /w:2 /log+:c:RobocopylogsHR01.LOG /TEE /FP
2020/01/07 14:06:11 ERROR 5 (0x00000005) Copying File \server1HR1. Employee Data1. Active1. Head officeHerson, Travis — Letter of Offer — 1 December 2015.pdf Access is denied.
Even though you can see the PDF it may still be permission issues, try taking ownership of the file and give yourself full control permissions, also make sure you run robocopy as administrator.
Best regards,
Leon
Blog: https://thesystemcenterblog.com LinkedIn:
Please check the share permission and NTFS permission, make sure that the account has enough permission for the file.
For non administrators, folders must be under full control. In addition, some subfolders have their own permissions, and these subfolders permission should also be assigned to non administrators.
Also can see here:
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact
I forgot to tell you i’m copying cross forest with two trust.
Robocopy \server1.abc.comHR \server2.xyz.comHR /XF thumbs.db *.tmp /XD DfsrPrivate /E /SEC /MOT:120 /XO /B /FFT /r:2 /w:2 /log+:c:RobocopylogsHR01.LOG /TEE /FP
i’m login to the server1.abc.com and running the above command. So i use below command before run the above.
net use \ server2.xyz.com data /user:xyzasxx *
Do i have to add xyz user to the ownership?
You’ve left out the most important information, you can refer to this link:
Blog: https://thesystemcenterblog.com LinkedIn:
i already followed that steps.
Blog: https://thesystemcenterblog.com LinkedIn:
First make sure you can even access and view stuff in the other domain, make sure you use the correct credentials.
Blog: https://thesystemcenterblog.com LinkedIn:
I can see the target folders by login to the source server .. also its got copy folders and sub folders but no file copy in some folders. i think i have to give full permission to source server for destination user.
2020/01/13 22:42:33 ERROR 5 (0x00000005) Copying File \server1.abc.comHR2. Site & Team FoldersAchiveDeeHR8. OtherWork Instructions — Ali & Dee 4.docx
Access is denied.
ERROR: RETRY LIMIT EXCEEDED.
0%
100%
New File 23131 \server1.abc.comHR2. Site & Team FoldersAchiveDeeHR8. OtherX1,TCS, ITIS, TP, X2 Payroll Calendar 2014-2015.xlsx
0%
100%
New File 162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other
$ccess Profile — Leader of Self — v1.docx
0%
100%
New File 162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other
$e Plakalovic — Annual Performance Review 2014.doc
0%
100%
New File 162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other
$R Audit List — 10.10.2014.docx
0%
100%
New Dir 5 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FT
New File 51690 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO Casual to Perm — Consolidated List of Employees.docx
2020/01/13 22:42:35 ERROR 5 (0x00000005) Copying File \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
Access is denied.
Waiting 2 seconds. Retrying.
New File 51690 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
2020/01/13 22:42:37 ERROR 5 (0x00000005) Copying File \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
Access is denied.
Waiting 2 seconds. Retrying.
Источник
-
Attention, TrueNAS Community Members.
General Help has now been set to read-only mode.
To make sure you can easily find what you’re looking for, we’ve relocated all relevant categories under their respective version. This change will simplify searching for information and minimize any confusion about where to post.
Register for the iXsystems Community to get an ad-free experience
-
Thread starter
arkoMax
-
Start date
Aug 15, 2017
- Status
- Not open for further replies.
-
#1
Hello,
I am trying to update directory/file timestamps using robocopy from my PC (Win7) but get an error «ERROR 5 (0x00000005) Time-Stamping Destination Directory… Access is denied».
The command I am using is:
robocopy source destination /e /COPY:DT /DCOPY:T /TIMFIX /FFT
The dataset owner, and user logged on to the PC, are the same. The dataset is mapped as a drive through an SMB share, and I have no problem copying/deleting content on the share. The security properties under win explorer show full access. This seems to be similar to the problem @Cosmo_Kramer was having here, but I have no idea what that fix does or how to implement it.
The output of getfacl of the share (getfacl /mnt/VOL1/media) is:
Code:
owner@:rwxpDdaARWcCos:fd-----:allow group@:rwxpDdaARWcCos:fd-----:allow everyone@:r-x---a-R-c---:fd-----:allow
Any assistance would be really appreciated.
-
#2
but I have no idea what that fix does or how to implement it.
Take a look at this. or this.
-
#3
Take a look at this. or this.
Thanks, I looked at those pages, but to be honest I don’t quite understand them. I am technical, but only in the windows world … I have no unix/linux experience and don’t really want to go punching commands into the CLI only presuming what will happen.
Any chance you could give me a bit more direct instructions?
-
#4
Why do you need /TIMFIX? Are you trying to robocopy a directory or an entire user profile?
One thing to bear in mind though is that by default FreeNAS has the samba parameter nfs4:mode = special
set. When you viewed your permissions from the CLI, you had
Code:
owner@:rwxpDdaARWcCos:fd-----:allow group@:rwxpDdaARWcCos:fd-----:allow everyone@:r-x---a-R-c---:fd-----:allow
These are special access control entries that are in the NFSv4 spec for compatibility with traditional posix mode bits (permissions). They behave differently than what you’d typically experience in windows. The closest approximation is «CREATOR OWNER» and «CREATOR OWNER-GROUP», which is (to simplify things) how they appear when nfs4:mode = simple
.
I think the best way to work around this is to set a new inheriting ACE at the root of your share for the group that you’re using to robocopy files. You can do this through File Explorer. (You can do the user, but I prefer to manage permissions through groups.)
-
#5
Well, I tried to reproduce your error with no success. Could you post the dataset and share settings? Also the SMB service settings?
Mines are: (I’m using FN 11-U2 and Windows 7 Pro x86)
-
#6
Thanks for your inputs guys, please find responses below.
A bit of background: the files/folders in question are my media (moves.. tv shows). I am migrating all content onto the FreeNAS. I had performed a copy of the content using win explorer. This has resulted in the folder modified/created times to set to the time of the copy. I need these to be the same times as the source. Kodi uses these times for its sorting (recently added etc). I had successfully used the robocopy command in the past to fix/match timestamps when copying content between external harddrives.
Why do you need /TIMFIX? Are you trying to robocopy a directory or an entire user profile?
As stated in the robocopy options, the /TIMFIX parameter «fixes file times on all files» … ie copies over the filetimes from the source to the destination directory of already copied content. The command that has always worked for me when needing to preserve timestamps is:
robocopy source destination /e /copyall /timfix /dcopy:t
Could you post the dataset and share settings? Also the SMB service settings?
Please see imgur album with all screenshots
I think the best way to work around this is to set a new inheriting ACE at the root of your share for the group that you’re using to robocopy files. You can do this through File Explorer. (You can do the user, but I prefer to manage permissions through groups.)
Not sure what this means … isnt this already set for my logged in user (as can be seen from the last image in the above album)? .. ie I already have «full control»
-
#7
I have managed to fix this issue and no longer get an error and access denied with robocopy.
In case someone else runs into this problem — I removed the «auxiliary parameters» I had set in the SMB settings (I had followed this post to add those parameters, but it obviously created an issue).
-
#8
Happy to hear it. Can you please mark this thread as Solved? You can find how here and here.
- Status
- Not open for further replies.
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:filesArchiveDir1Dir2
Dest : \nasfooBackfooDriveAuto2ArchiveDir1Dir2
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DATS /PURGE /MIR /R:10 /W:5
------------------------------------------------------------------------------
1 F:filesArchiveDir1Dir2
2 F:filesArchiveDir1Dir21-11-2010
2017/02/19 17:01:16 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir21-11-2010
Access is denied.
1 F:filesArchiveDir1Dir21_09_2010
Modified 62899 Production Hours + Progress 01-09-2010.xlsx
1 F:filesArchiveDir1Dir22-11-2010
2017/02/19 17:01:16 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir22-11-2010
Access is denied.
1 F:filesArchiveDir1Dir22_06_2010
2017/02/19 17:01:16 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir22_06_2010
Access is denied.
1 F:filesArchiveDir1Dir23-11-2010
2017/02/19 17:01:17 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir23-11-2010
Access is denied.
1 F:filesArchiveDir1Dir23_06_2010
3 F:filesArchiveDir1Dir24_05_2010
1 F:filesArchiveDir1Dir26-10-2010
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir26-10-2010
Access is denied.
0 F:filesArchiveDir1Dir27-08-10
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir27-08-10
Access is denied.
3 F:filesArchiveDir1Dir28-07-10
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir28-07-10
Access is denied.
1 F:filesArchiveDir1Dir29-06-2010
2017/02/19 17:01:18 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir29-06-2010
Access is denied.
5 F:filesArchiveDir1Dir210_06_2010
3 F:filesArchiveDir1Dir212-10-2010
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir212-10-2010
Access is denied.
2 F:filesArchiveDir1Dir213_05_2010
1 F:filesArchiveDir1Dir215-07-10
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir215-07-10
Access is denied.
1 F:filesArchiveDir1Dir215-09-2010
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir215-09-2010
Access is denied.
1 F:filesArchiveDir1Dir217-08-10
2017/02/19 17:01:19 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir217-08-10
Access is denied.
3 F:filesArchiveDir1Dir217_06_2010
2017/02/19 17:01:20 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir217_06_2010
Access is denied.
2 F:filesArchiveDir1Dir219-10-2010
2017/02/19 17:01:20 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir219-10-2010
Access is denied.
1 F:filesArchiveDir1Dir220-10-2010
2017/02/19 17:01:20 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir220-10-2010
Access is denied.
1 F:filesArchiveDir1Dir220_05_2010
1 F:filesArchiveDir1Dir221-07-10
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir221-07-10
Access is denied.
1 F:filesArchiveDir1Dir221-10-2010
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir221-10-2010
Access is denied.
1 F:filesArchiveDir1Dir222-09-2010
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir222-09-2010
Access is denied.
1 F:filesArchiveDir1Dir222-10-2010
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir222-10-2010
Access is denied.
2 F:filesArchiveDir1Dir223_06_2010
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir223_06_2010
Access is denied.
1 F:filesArchiveDir1Dir225-10-2010
2017/02/19 17:01:21 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir225-10-2010
Access is denied.
1 F:filesArchiveDir1Dir227-10-2010
2017/02/19 17:01:22 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir227-10-2010
Access is denied.
1 F:filesArchiveDir1Dir227_05_2010
1 F:filesArchiveDir1Dir229-07-10
2017/02/19 17:01:22 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir229-07-10
Access is denied.
2 F:filesArchiveDir1Dir229-09-10
2017/02/19 17:01:23 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir229-09-10
Access is denied.
2 F:filesArchiveDir1Dir230-06-10
2017/02/19 17:01:23 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir230-06-10
Access is denied.
1 F:filesArchiveDir1Dir2Project Closure July 2010
2017/02/19 17:01:23 ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory \nasfooBackfooDriveAuto2ArchiveDir1Dir2Project 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.
asked Feb 19, 2017 at 16:15
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 Apr 5, 2020 at 8:14
StuggiStuggi
3,4164 gold badges19 silver badges34 bronze badges
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 Aug 8, 2017 at 11:49
Infopackets Reader Gerry J. writes:
» Dear Dennis,
Thanks for your article on how to reset admin password on a Seagate NAS (network attached storage) — this was the only article I could find on the subject. I have a related question. I’ve done a full reset of the NAS (wiping out all data) and recreated my network shares, and now I’m ready to copy data back. In the past, I’ve used Windows file copy to do this, but sometimes it fails and then I have to start over again. I did research on this subject and it’s my understanding robocopy is a much more reliable method and will actually resume the transfer if interrupted. The problem is that every time I try to copy the data back to the NAS, I keep getting an error ‘ERROR 5 (0x00000005) Changing File Attributes’. I can’t seem to find the answer to this and require your expertise. Can you please help? «
My response:
I asked Gerry if he would like me to connect to his machine using
my remote desktop support service in order to have a closer look, and he agreed.
Below I will discuss my findings.
How to Fix: NAS, Robocopy ERROR 5 (0x00000005) Changing File Attributes
After some research, it appears that when robocopy copies files, it will (by
default) attempt to store file attributes in addition to the data and time
stamps on the destination media.
Since a NAS is essentially a mini Linux machine (box) with hard drives attached to it, attempting to modify file attributes will result in an error because Linux is in control of the storage and only permits limited changes to files — even while copying a file.
Therefore, the way to get around this problem is to not to copy the file attributes using robocopy’s command line arguments.
For example, the following command would work:
robocopy e:temp s: /e /copy:DT /w:1 /r:1 /v /log:»c:temprobocopy_copy_back_to_nas.txt»
This assumes the e:temp is the source directory and s: is the destination (NAS). The
/copy:DT switch tells robocopy to copy the data and time stamps (but
not the file attributes), while /w:1 and r:/1 says to only retry a maximum of 1 times if there is an error in the file copy, with 1 second intervals between retries. The /log:»c:temprobocopy_copy_back_to_nas.txt» line means to make a log of the file copy and save it to c:temprobocopy_copy_back_to_nas.txt, while the /v switch means to log verbose errors such as skipped files or files with errors.
How to View Robocopy Log Output (Powershell)
If you want to view the log while it’s copying, open up a powershell command prompt and run the following script:
Get-Content c:temprobocopy_copy_back_to_nas.txt -tail 1 -wait
This will provide you with a window of activity (with 1 second intervals) to
see the progress. In Gerry’s case it took over a week to copy the data back onto
the NAS, so this was incredibly useful — plus he can parse the log file for
errors if needed, described next.
How to View Robocopy Log for Errors
To scan the above log file for the word «error», you could use the following
syntax via the command line (with limitations):
type c:temprobocopy_copy_back_to_nas.txt |findstr -i error >c:temprobocopy_error_log.txt
This will output any error messages to c:temprobocopy_error_log.txt —
however you may need to open the log to find the exact reason for the error.
Frankly speaking that might be irrelevant because if the file won’t copy, it
likely won’t ever copy (due to a media error, for example). That said, it’s
worth looking at a few errors to see if the error messages are all the same. In
that case there could be a problem with the source or possibly the robocopy
arguments.
If you want a much more robust way
to extract robocopy errors from the log, consider using this powershell command
script as discussed on this page.
How to Log Robocopy Errors Only
If you only want to log only errors from robocopy regardless of the error reason, you can use this method:
robocopy [source] [destination] /copy:DT /w:1 /r:1 /nfl /ndl /njh /njs /ns /nc /np >> log.txt
I hope that helps.
Additional 1-on-1 Support: From Dennis
If all of this is over your head, or if you’re having trouble setting up your
NAS / copying files, etc — I can assist using
my remote desktop support service. Simply
contact me, briefly describing
the issue and I’ll get back to you as soon as possible.
Got a Computer Question or Problem? Ask Dennis!
I need more questions. If you have a computer question — or even a computer
problem that needs fixing please email me with your question
so that I can write more articles like this one. I can’t promise I’ll respond to
all the messages I receive (depending on the volume), but I’ll do my best.
About the author: Dennis Faas is the owner and operator of
Infopackets.com. With over 30 years of computing experience, Dennis’ areas of
expertise are a broad range and include PC hardware, Microsoft Windows, Linux,
network administration, and virtualization. Dennis holds a Bachelors degree in
Computer Science (1999) and has authored 6 books on the topics of MS Windows and
PC Security. If you like the advice you received on this page, please up-vote /
Like this page and share it with friends. For technical support inquiries,
Dennis can be reached via Live chat online this site using the Zopim Chat
(currently located at the bottom left of the screen); optionally, you can
contact Dennis through the website
contact form.