备份文件,并且保留权限

it2022-05-05  149

由于最近公司文件服务器扩容,使用Raid 5来实现,需要备份一下原来的数据,但是备份的时候,如果简单的把文件复制到另外一个硬盘,所有的权限设置都没有了。 在网上搜索了一会,微软给了2个工具permcopy和scopy,但是scopy找不到了,据说在 Windows NT Server 4.0 Resource Kit 里面,但是找不到。 终于在一个中文的blog上找到了一个文章,使用Xcopy也可以实现。 http://allenggg.spaces.live.com/blog/cns!49B6CFCD69ECA1C8!215.entry,多谢这位小拐。 我增加了一个参数/C ------------------------------------------------------------------

可以使用带 /O /X /E /H /K /C 开关的 Xcopy 命令复制文件并保留已明确应用于这些文件的现有权限。将一个文件夹复制到另一个文件夹中并保留其权限1. 单击开始,然后单击运行。2. 在打开框中,键入 cmd,然后单击确定。3. 键入 xcopy sourcedestination /O /X /E /H /K ,然后按 Enter,其中 source 是要复制的文件的源路径,destination 是这些文件的目标路径。

 /O           Copies file ownership and ACL information. /X           Copies file audit settings (implies /O). /E           Copies directories and subdirectories, including empty ones.              Same as /S /E. May be used to modify /T. /H           Copies hidden and system files also. /C           Continues copying even if errors occur. /K           Copies attributes. Normal Xcopy will reset read-only attributes.

转载于:https://www.cnblogs.com/LearnSap/archive/2009/08/12/1544300.html

相关资源:NTFS权限备份和恢复工具

最新回复(0)