Skip to main content
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

复制

贡献者

copy 命令会扫描整个源目录结构并将其复制到目标SMB共享。。 copy 命令需要源路径和目标路径作为变量。扫描和复制的文件,吞吐量 / 速度和已用时间详细信息每五秒打印一次到控制台。

备注
  • 运行时日志文件存储在C:\NetApp\XCP下。

  • copy 命令复制数据而不使用访问控制列表(ACL)。

语法
xcp copy \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\netapp\xcp>xcp copy \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

xcp copy \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
317 scanned, 0 matched, 316 copied, 0 errors
Total Time : 2s
STATUS : PASSED

下表列出了 copy 参数及其问题描述。

参数 Description

copy -h、--help

显示有关的详细信息 copy 命令:

copy -v

增加调试详细信息。

<<smb_copy_parallel,复制-并行();n

指定并发进程的数量(默认值:<cpu-count>)。

<<smb_copy_match,复制-匹配();过滤器();

仅处理与筛选器匹配的文件和目录(请参见 xcp help - match 有关详细信息、请参见)。

<<smb_copy_exclude,复制-排除();过滤器();

仅在筛选器中排除文件和目录

copy -놣 듦-地

还原源上上次访问的日期。

copy -acl

复制安全信息。

<<smb_copy_acl,copy -fallback-user

指定目标计算机上接收本地(非域)源计算机用户权限的Active Directory用户或本地(非域)用户。例如、domain\administrator。

<<smb_copy_acl,copy -fallback-group

指定目标计算机上接收本地(非域)源计算机组权限的Active Directory组或本地(非域)组。例如、domain\administrators。

copy -root

复制根目录的ACL。

copy -aclverify{yes, no}

提供了一个选项、用于在复制-acl操作期间跳过或包括ACL验证。

copy -no所有权

不复制所有权。

<<smb_copy_bs,copy -BS ();n

读/写块大小(默认值:1M)

copy -ADS

将源SMB共享中的NTFS备用数据流复制到目标SMB共享。

copy -h、--help

使用 -h–-help 参数 copy 命令以显示有关的详细信息 copy 命令

语法
xcp copy –help
显示示例
C:\netapp\xcp>xcp copy –help

usage: xcp copy [-h] [-v] [-parallel <n>] [-match <filter>] [-exclude <filter>] [-preserve- atime] [-acl] [-fallback-user FALLBACK_USER]
[-fallback-group FALLBACK_GROUP] [-loglevel <name>] [-root] [-noownership] [- aclverify {yes,no}] [-bs <n>] [-ads]
         source target

positional arguments:
   source
   target

optional arguments:
-h, --help            show this help message and exit
-v                    increase debug verbosity
-parallel <n>         number of concurrent processes (default: <cpu-count>)
-match <filter>       only process files and directories that match the filter (see `xcp help -match` for details)
-exclude <filter>     Exclude files and directories that match the filter (see `xcp help - exclude` for details)
-preserve-atime       restore last accessed date on source
-acl                  copy security information
-fallback-user FALLBACK_USER
                      the name of the user on the target machine to receive the permissions of local (non-domain) source machine users (eg. domain\administrator)
-fallback-group FALLBACK_GROUP
                      the name of the group on the target machine to receive the permissions of local (non-domain) source machine groups (eg. domain\administrators)
-loglevel <name>      option to set log level filter (default:INFO)
-root                 copy acl for root directory
-noownership          do not copy ownership
-aclverify {yes,no}   choose whether you need to skip acl verification
-bs <n>               read/write block size for copy (default: 1M)
-ads                  copy NTFS alternate data streams.

copy -v

使用 -v 参数 copy 命令以提供详细的调试信息。

语法
xcp copy -v \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\netapp\xcp>xcp copy -v \\<IP address of SMB destination server>\src \\<IP address of SMB destination server>\dest\d1

failed to set attributes for "d1": (5, 'CreateDirectory', 'Access is denied.')
failed to copy "f1.txt": (5, 'CreateFile', 'Access is denied.')
failed to set attributes for "": (5, 'SetFileAttributesW', 'Access is denied.') error setting timestamps on "": errno (code: 5) Access is denied.
H:\p 4\xcp_latest\xcp_cifs\xcp\ main .py copy -v \\<IP address of SMB destination server>\src \\<IP address of SMB destination server>\dest\d1
3 scanned, 0 matched, 0 skipped, 1 copied, 0 (0/s), 3 errors
Total Time : 3s
STATUS : FAILED

copy -par行并行<n>

使用 -parallel <n> 参数 copy 命令以设置更多或更少的XCP并发进程数。的默认值 -parallel 等于CPU计数。

备注 n的最大值为61。
语法
xcp copy -parallel <n> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\netapp\xcp>xcp copy -parallel 7	\\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

xcp copy -parallel 7 \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
317 scanned, 0 matched, 316 copied, 0errors
Total Time : 2s
STATUS : PASSED

copy -match <filter>

使用 -match <filter> 参数 copy 命令以仅复制与传递的参数匹配的数据。

语法
xcp copy -match <filter> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\netapp\xcp>xcp copy -match "'gx' in name" \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

xcp copy -match 'gx' in name \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
317 scanned, 5 matched, 4 copied, 0 errors
Total Time : 1s
STATUS : PASSED

copy -排除<filter>

使用 -exclude <filter> 参数 copy 命令以仅复制排除的数据。

语法
xcp copy -exclude <filter> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

在以下示例中、已排除名称中包含字符串"resync"的文件和目录的副本。

显示示例
c:\netapp\xcp>xcp copy -exclude "'resync' in name" \\<IP address or hostname of SMB server>\source_share \\<IP address or hostname of SMB server>\dest_share


xcp copy -exclude 'resync' in name \\<IP address or hostname of SMB server>\source_share \\\\<IP address or hostname of SMB server>\dest_share
18 scanned, 2 excluded, 0 skipped, 15 copied, 122KiB (50.5KiB/s), 0 errors
Total Time : 2s
STATUS : PASSED

copy -놣 듦-地

使用 -preserve-atime 参数 copy 命令将"adi"重置为原始值、然后XCP读取文件。

语法
xcp copy -preserve-atime \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\netapp\xcp>xcp copy -preserve-atime \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

xcp copy -preserve-atime \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
317 scanned, 0 matched, 316 copied, 0 errors
Total Time : 2s
STATUS : PASSED

copy -acl -reallback-user <fallback_user>-reallback-group <fallback_group>

使用 -acl 参数 copy 命令以激活安全描述符(ACL)的传输。

使用 -acl 参数 -fallback-user-fallback-group 用于在目标计算机上或从Active Directory指定用户和组以接收本地(非域)源计算机用户或组的权限的选项。这并不是指Active Directory中不匹配的用户。

语法
xcp copy -acl -fallback-user <fallback_user> -fallback-group <fallback_group> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

copy -aclverify{yes, no}

使用 -aclverify {yes,no} 参数 copy 命令、用于在ACL复制操作期间跳过或包含ACL验证。

您必须使用 -aclverify {yes,no} 参数 copy -acl 命令:默认情况下、ACL复制操作会验证ACL。如果您设置了 -aclverify 选项 no,则可以跳过ACL验证和 fallback-userfallback-group 不需要选项。如果您设置了 -aclverify to yes,则需要 fallback-userfallback-group 选项、如以下示例所示。

语法
xcp copy -acl -aclverify yes -fallback-user <fallback_user> -fallback-group <fallback_group> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
C:\NetApp\xcp>xcp copy -acl -aclverify yes -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group"
\\<source_IP_address>\source_share \\<destination_IP_address>\dest_share

12 scanned, 0 matched, 0 skipped, 0 copied, 0 (0/s), 0 errors, 5s, 0 acls copied
12 scanned, 0 matched, 0 skipped, 0 copied, 0 (0/s), 0 errors, 10s, 0 acls copied
12 scanned, 0 matched, 0 skipped, 0 copied, 0 (0/s), 0 errors, 15s, 0 acls copied xcp copy -acl -aclverify yes -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group" \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share
12 scanned, 0 matched, 0 skipped, 11 copied, 10KiB (634/s), 0 errors, 11 acls copied
Total Time : 16s
STATUS : PASSED

C:\NetApp\xcp>xcp copy -acl -aclverify no \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share

xcp copy -acl -aclverify no \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share
12 scanned, 0 matched, 0 skipped, 11 copied, 10KiB (5.61KiB/s), 0 errors, 11 acls copied
Total Time : 1s
STATUS : PASSED

copy -root

使用 -root 参数 copy 命令以复制根目录的ACL。

语法
xcp copy -acl -root -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group" \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
C:\NetApp\XCP>xcp copy -acl -root -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group" \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share

xcp copy -acl -root -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group" \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
6 scanned, 0 matched, 0 skipped, 5 copied, 200 (108/s), 0 errors, 6 acls copied
Total Time : 1s
STATUS : PASSED

copy -no所有权

使用 -noownership 参数 copy 用于指定不将所有权从源复制到目标的命令。您必须使用 -noownership 使用 -acl 选件 fallback-userfallback-group 作为必需参数。

语法
xcp.exe copy -acl -noownership -fallback-user <fallback_user> -fallback-group <fallback_group> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
C:\Netapp\xcp>xcp.exe copy -acl -noownership -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group" \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share

568 scanned, 0 matched, 0 skipped, 0 copied, 0 (0/s), 0 errors, 5s, 0 acls copied
568 scanned, 0 matched, 0 skipped, 0 copied, 0 (0/s), 0 errors, 10s, 0 acls copied
568 scanned, 0 matched, 0 skipped, 135 copied, 4.26MiB (872KiB/s), 0 errors, 15s, 137 acls copied xcp.exe copy -acl -noownership -fallback-user "DOMAIN\User" -fallback-group "DOMAIN\Group" \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share
568 scanned, 0 matched, 0 skipped, 567 copied, 17.7MiB (1.01MiB/s), 0 errors, 567 acls copied
Total Time : 17s
STATUS : PASSED

copy -BS <n>

使用 -bs <n> 参数 copy 命令以提供读/写块大小。默认值为1M。

语法
xcp.exe copy -bs <n> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\Netapp\xcp>xcp.exe copy -bs 32k \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share

xcp.exe copy -bs 32k \\<source_IP_address>\source_share \\<destination_IP_address>\dest_share
568 scanned, 0 matched, 0 skipped, 567 copied, 17.7MiB (6.75MiB/s), 0 errors
Total Time : 2s
STATUS : PASSED

copy -ADS

使用 -ads 参数 copy 用于将NTFS备用数据流从源SMB共享复制到目标SMB共享的命令。

语法
xcp copy -ads \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
显示示例
c:\netapp\xcp>xcp copy -ads \\<source_IP_address>\source_share\src \\<dest_IP_address>\dest_share

6   scanned, 0 matched, 0 skipped, 3 copied, 13 (2.41/s), 0 errors, 5s, 10 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	10s, 11 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	15s, 12 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	20s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	25s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	30s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	35s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	40s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	45s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	2m15s, 13 ads copied
6	scanned,	0	matched,	0	skipped,	3	copied,	13	(0/s),	0	errors,	3m5s, 13 ads copied
xcp copy -ads \\<source_IP_address>\source_share\src \\<desination_IP_address>\dest_share
6 scanned, 0 matched, 0 skipped, 5 copied, 26 (0.137/s), 0 errors, 14 ads copied
Total Time : 3m9s
STATUS : PASSED