Symptoms
Consider the following scenario:
-
You add a user account to the domain Backup Operators group or to the local Backup Operators group.
-
You use this account to log on to a computer that is running Windows 7 or Windows Server 2008 R2.
-
You use the Robocopy command together with the /B option to copy some files that you do not have access permissions or ownership.
In this scenario, these files are copied successfully. However, their security configuration information such as an access control list (ACL) is not copied. Instead, these files inherit their ACL from the destination folder.
Additionally, the Robocopy.exe utility returns one of the following error messages:
-
ERROR 5 (0x00000005) Copying NTFS Security to Destination Directory <directory name> Access is denied -
ERROR 5 (0x00000005) Copying NTFS Security to Destination File<directory name> Access is denied
Note When a member of the Backup Operators group runs the Robocopy.exe utility together with the /B option to copy a file, everything should be copied. The member should have access to the file security configuration information even if the member does not have permissions to the file or ownership of the file.
Cause
This issue occurs because the Robocopy.exe utility does not open these files by using the «backup intent» flag when the /B option is used. This behavior prevents access to the security configuration information for a user who has the «Back up files and directories» (SE_BACKUP_PRIVILEGE) privilege.
Note If a file is opened by using the «backup intent» flag, certain access rights are checked, and then the user who opened the file is granted the appropriate access to the file.
Resolution
Hotfix information
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.
If the hotfix is available for download, there is a «Hotfix download available» section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=supportNote The «Hotfix download available» form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
Prerequisites
To apply this hotfix, your computer must be running Windows Server 2008 R2 or Windows 7.
Restart requirement
You do not have to restart the computer after you apply this hotfix.
Hotfix replacement information
This hotfix does not replace a previously released hotfix.
File information
The English (United States) version of this hotfix installs files that have the attributes that are listed in the following tables. The dates and the times for these files are listed in Coordinated Universal Time (UTC). The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and the times may change when you perform certain operations on the files.
Windows 7 and Windows Server 2008 R2 file information notes
Important Windows 7 hotfixes and Windows Server 2008 R2 hotfixes are included in the same packages. However, hotfixes on the Hotfix Request page are listed under both operating systems. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under «Windows 7/Windows Server 2008 R2» on the page. Always refer to the «Applies To» section in articles to determine the actual operating system that each hotfix applies to.
-
The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately in the «Additional file information for Windows Server 2008 R2 and for Windows 7» section. MUM and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintain the state of the updated components. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.
For all supported x86-based versions of Windows 7
File name |
File version |
File size |
Date |
Time |
Platform |
---|---|---|---|---|---|
Robocopy.exe |
5.1.10.1027 |
98,816 |
19-Feb-2010 |
07:55 |
x86 |
For all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
File name |
File version |
File size |
Date |
Time |
Platform |
---|---|---|---|---|---|
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 |
For all supported IA-64-based versions of Windows Server 2008 R2
File name |
File version |
File size |
Date |
Time |
Platform |
---|---|---|---|---|---|
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 |
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.
More Information
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
973776 The security configuration information, such as the ACL, is not copied if a backup operator uses the Robocopy.exe utility together with the /B option to copy a file on a computer that is running Windows Vista or Windows Server 2008
Additional file information
Additional file information for Windows 7 and for Windows Server 2008 R2
Additional files for all supported x86-based versions of Windows 7
File name |
Update.mum |
File version |
Not applicable |
File size |
1,674 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
X86_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_9cf47061efb3ad1e.manifest |
File version |
Not applicable |
File size |
696 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest |
File version |
Not applicable |
File size |
2,586 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
08:24 |
Platform |
Not applicable |
Additional files for all supported IA-64-based versions of Windows Server 2008 R2
File name |
Ia64_558f690380b00de69835c91def69e446_31bf3856ad364e35_6.1.7600.20648_none_6b75fb69a08aba9d.manifest |
File version |
Not applicable |
File size |
698 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
Ia64_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_9cf61457efb1b61a.manifest |
File version |
Not applicable |
File size |
697 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
Ia64_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c7970abf66b0517f.manifest |
File version |
Not applicable |
File size |
2,588 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
09:25 |
Platform |
Not applicable |
File name |
Update.mum |
File version |
Not applicable |
File size |
1,684 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest |
File version |
Not applicable |
File size |
2,586 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
08:24 |
Platform |
Not applicable |
Additional files for all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
File name |
Amd64_289a23833955983618528339f2d450e2_31bf3856ad364e35_6.1.7600.20648_none_b09b47b22cf89dfe.manifest |
File version |
Not applicable |
File size |
700 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not Applicable |
File name |
Amd64_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_f9130be5a8111e54.manifest |
File version |
Not applicable |
File size |
698 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
Amd64_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_23b4024d1f0fb9b9.manifest |
File version |
Not applicable |
File size |
2,590 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
09:31 |
Platform |
Not Applicable |
File name |
Update.mum |
File version |
Not applicable |
File size |
2,328 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
10:58 |
Platform |
Not applicable |
File name |
X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest |
File version |
Not applicable |
File size |
2,586 |
Date (UTC) |
19-Feb-2010 |
Time (UTC) |
08:24 |
Platform |
Not applicable |
Need more help?
Want more options?
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
Симптомы
Рассмотрим следующий сценарий:
-
Добавить учетную запись пользователя группе операторов архива домена или локальной группы «Операторы архива».
-
Эта учетная запись используется для входа на компьютер под управлением 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 |
Платформа |
Неприменимо |
check
Best Answer
OP
MB13977
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.
chipotle
This was down to file permissions in the end. I ended up having to take ownership then give the administrator permissions.
I created two batch files with the following commands to do this:
takeown /F <username>\AppData /R /D y
icacls <username>\AppData /reset
Was this post helpful?
thumb_up
thumb_down
View Best Answer in replies below
5 Replies
-
tfl
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.mace
It may be that the folder in question actually has been set to deny you access. There are a bunch of folders under Windows folder that are not normally accessible.
What folders?
Was this post helpful?
thumb_up
thumb_down
-
OP
MB13977
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.chipotle
Thanks for the reply tfl.
It looks like it’s profiles, various files in …\AppData\Roaming\… <filename>.thmx among others.
Was this post helpful?
thumb_up
thumb_down
-
tfl
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.mace
Yes — those are probably locked down too.
You can try changing the ACLs — but that could be a pretty tedious job.
Was this post helpful?
thumb_up
thumb_down
-
OP
MB13977
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.chipotle
I thought using the /B for Backup mode would still copy them.
I found this post, about 8 posts down from N. Naik, about a script to fix it. What do you think?
https://social.technet.microsoft.com/Forums/office/en-US/fcac089c-f2e5-4b2d-9e4f-ec637f8ead52/roboco… Opens a new window
Was this post helpful?
thumb_up
thumb_down
-
OP
MB13977
This person is a verified professional.
Verify your account
to enable IT peers to see that you are a professional.chipotle
This was down to file permissions in the end. I ended up having to take ownership then give the administrator permissions.
I created two batch files with the following commands to do this:
takeown /F <username>\AppData /R /D y
icacls <username>\AppData /reset
Was this post helpful?
thumb_up
thumb_down
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" "\\OtherServer\C$\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
22.7k14 gold badges112 silver badges118 bronze badges
It may be a simple answer… check the space left on the Target drive.
answered Jun 28 at 14:12
1
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:\temp\robocopy_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:\temp\robocopy_copy_back_to_nas.txt» line means to make a log of the file copy and save it to c:\temp\robocopy_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:\temp\robocopy_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:\temp\robocopy_copy_back_to_nas.txt |findstr -i error >c:\temp\robocopy_error_log.txt
This will output any error messages to c:\temp\robocopy_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.