copy
The copy command scans and copies the entire source directory structure to a destination SMB share. The copy command requires source and destination paths as variables. The scanned and copied files, throughput/speed, and elapsed time details are printed to the console once every five seconds.
|
|
|
xcp copy \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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
The following table lists the copy parameters and their description.
| Parameter | Description |
|---|---|
Displays detailed information about the |
|
Increase debug verbosity. |
|
Specifies the number of concurrent processes (default: <cpu-count>). |
|
Only processes files and directories that match the filter (see |
|
Only excludes files and directories in the filter |
|
Restores last accessed date on source. |
|
Copies security information. |
|
Specifies the Active Directory user or local (non-domain) user on the target machine that receives the permissions of local (non-domain) source machine users. For example, domain\administrator. |
|
Specifies the Active Directory group or local (non-domain) group on the target machine that receives the permissions of local (non-domain) source machine groups. For example, domain\administrators. |
|
Copies the ACLs for a root directory. |
|
Provides an option to skip or include ACL verification during the copy -acl operation. |
|
Does not copy ownership. |
|
Read/Write blocksize (default:1M) |
|
Copies NTFS alternate data streams from the source SMB share to the destination SMB share. |
copy -h, --help
Use the -h and –-help parameters with the copy command to display detailed information about the copy command
xcp copy –help
Show example
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
Use the -v parameter with the copy command to provide detailed debug information.
xcp copy -v \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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 -parallel <n>
Use the -parallel <n> parameter with the copy command to set a higher or lower number of XCP concurrent processes. The default value for -parallel is equal to the CPU count.
|
|
The maximum value for n is 61. |
xcp copy -parallel <n> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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>
Use the -match <filter> parameter with the copy command to copy only the data that matches the argument passed.
xcp copy -match <filter> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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 -exclude <filter>
Use the -exclude <filter> parameter with the copy command to only copy excluded data.
xcp copy -exclude <filter> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
In the following example, the files and directories that have the string "resync" in their name have been excluded for copy.
Show example
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
Use the -preserve-atime parameter with the copy command to reset the "atime" to the original value before XCP read the file.
xcp copy -preserve-atime \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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 -fallback-user <fallback_user> -fallback-group <fallback_group>
Use the -acl parameter with the copy command to activate the transfer of the security descriptors (ACLs).
Use the -acl parameter with the -fallback-user and -fallback-group options to specify a user and a group on the target machine or from Active Directory to receive the permissions of local (non-domain) source machine users or groups. This does not refer to unmatched users from an 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}
Use the -aclverify {yes,no} parameter with the copy command to provide an option to skip or include ACL verification during an ACL copy operation.
You must use the -aclverify {yes,no} parameter with the copy -acl command. By default, the ACL copy operation verifies the ACLs. If you set the -aclverify option to no, you can skip ACL verification and the fallback-user and fallback-group options are not required. If you set -aclverify to yes, it requires the fallback-user and fallback-group options, as shown in the following example.
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
Show example
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
Use the -root parameter with the copy command to copy the ACLs for the root directory.
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
Show example
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 -noownership
Use the -noownership parameter with the copy command to specify not to copy the ownership from the source to the destination. You must use -noownership with the -acl option and it requires fallback-user and fallback-group as mandatory parameters.
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
Show example
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>
Use the -bs <n> parameter with the copy command to provide a read/write block size. The default value is 1M.
xcp.exe copy -bs <n> \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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
Use the -ads parameter with the copy command to copy NTFS alternate data streams from the source SMB share to destination SMB share.
xcp copy -ads \\<IP address or hostname of SMB server>\source_share \\<IP address of SMB destination server>\dest_share
Show example
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