azcopy copyazcopy copy

将源数据复制到目标位置。Copies source data to a destination location.

摘要Synopsis

将源数据复制到目标位置。Copies source data to a destination location. 支持的方向如下:The supported directions are:

  • 本地 <-> Azure Blob(SAS 或 OAuth 身份验证)local <-> Azure Blob (SAS or OAuth authentication)
  • 本地 <-> Azure 文件存储(共享/目录 SAS 身份验证)local <-> Azure Files (Share/directory SAS authentication)
  • 本地 <-> Azure Data Lake Storage Gen 2(SAS、OAuth 或共享密钥身份验证)local <-> Azure Data Lake Storage Gen 2 (SAS, OAuth, or shared key authentication)
  • Azure Blob(SAS 或公共)-> Azure Blob(SAS 或 OAuth 身份验证)Azure Blob (SAS or public) -> Azure Blob (SAS or OAuth authentication)
  • Azure Blob(SAS 或公共)-> Azure 文件存储 (SAS)Azure Blob (SAS or public) -> Azure Files (SAS)
  • Azure 文件存储 (SAS) -> Azure 文件存储 (SAS)Azure Files (SAS) -> Azure Files (SAS)
  • Azure 文件存储 (SAS) -> Azure Blob(SAS 或 OAuth 身份验证)Azure Files (SAS) -> Azure Blob (SAS or OAuth authentication)
  • Amazon Web Services (AWS) S3(访问密钥)-> Azure 块 Blob(SAS 或 OAuth 身份验证)Amazon Web Services (AWS) S3 (Access Key) -> Azure Block Blob (SAS or OAuth authentication)

有关详细信息,请参阅本文的示例部分。For more information, see the examples section of this article.

高级Advanced

从本地磁盘上传时,AzCopy 将自动检测文件的内容类型。AzCopy automatically detects the content type of the files when you upload them from the local disk. AzCopy 会根据文件扩展名或内容(如果未指定扩展名)检测文件的内容类型。AzCopy detects the content type based on the file extension or content (if no extension is specified).

内置的查找表较小,但在 Unix 上,已通过采用以下一个或多个名称的本地系统 mime.types 文件(如果可用)扩充了该查找表:The built-in lookup table is small, but on Unix, it is augmented by the local system's mime.types file(s) if they are available under one or more of these names:

  • /etc/mime.types/etc/mime.types
  • /etc/apache2/mime.types/etc/apache2/mime.types
  • /etc/apache/mime.types/etc/apache/mime.types

在 Windows 上,MIME 类型是从注册表提取的。On Windows, MIME types are extracted from the registry. 可以借助一个标志禁用此功能。This feature can be turned off with the help of a flag. 有关详细信息,请参阅本文中的标志部分。For more information, see the flag section of this article.

如果使用命令行设置环境变量,则可以在命令行历史记录中读取该变量。If you set an environment variable by using the command line, that variable will be readable in your command-line history. 请考虑从命令行历史记录中清除包含凭据的变量。Consider clearing variables that contain credentials from your command-line history. 若要防止变量出现在历史记录中,可以使用脚本提示用户输入凭据,并设置环境变量。To keep variables from appearing in your history, you can use a script to prompt the user for their credentials, and to set the environment variable.

azcopy copy [source] [destination] [flags]

示例Examples

使用 OAuth 身份验证上传单个文件。Upload a single file by using OAuth authentication. 如果尚未登录到 AzCopy,请在运行以下命令之前运行 azcopy login 命令。If you have not yet logged into AzCopy, run the azcopy login command before you run the following command.

azcopy cp "/path/to/file.txt" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]"

与前面的示例相同,但这一次此命令还会计算文件内容的 MD5 哈希,并将其另存为 Blob 的 Content-MD5 属性:Same as above, but this time, also compute MD5 hash of the file content and save it as the blob's Content-MD5 property:

azcopy cp "/path/to/file.txt" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]" --put-md5

使用 SAS 令牌上传单个文件:Upload a single file by using a SAS token:

azcopy cp "/path/to/file.txt" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]"

使用 SAS 令牌和管道(仅限块 Blob)上传单个文件:Upload a single file by using a SAS token and piping (block blobs only):

cat "/path/to/file.txt" | azcopy cp "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]"

使用 SAS 令牌上传整个目录:Upload an entire directory by using a SAS token:

azcopy cp "/path/to/dir" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive

or

azcopy cp "/path/to/dir" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive --put-md5

使用 SAS 令牌和通配符 (*) 上传一组文件:Upload a set of files by using a SAS token and wildcard (*) characters:

azcopy cp "/path/*foo/*bar/*.pdf" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]"

使用 SAS 令牌和通配符 (*) 上传文件和目录:Upload files and directories by using a SAS token and wildcard (*) characters:

azcopy cp "/path/*foo/*bar*" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive

使用 OAuth 身份验证下载单个文件。Download a single file by using OAuth authentication. 如果尚未登录到 AzCopy,请在运行以下命令之前运行 azcopy login 命令。If you have not yet logged into AzCopy, run the azcopy login command before you run the following command.

azcopy cp "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]" "/path/to/file.txt"

使用 SAS 令牌下载单个文件:Download a single file by using a SAS token:

azcopy cp "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]" "/path/to/file.txt"

使用 SAS 令牌下载单个文件,然后通过管道将输出传送到文件(仅限块 Blob):Download a single file by using a SAS token and then piping the output to a file (block blobs only):

azcopy cp "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]" > "/path/to/file.txt"

使用 SAS 令牌下载整个目录:Download an entire directory by using a SAS token:

azcopy cp "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" "/path/to/dir" --recursive

有关在 URL 中使用通配符 (*) 的说明:A note about using a wildcard character (*) in URLs:

仅支持通过两种方式在 URL 中使用通配符。There's only two supported ways to use a wildcard character in a URL.

  • 紧接在 URL 的最后一个正斜杠 (/) 后面使用一个通配符。You can use one just after the final forward slash (/) of a URL. 通配符的这种用法会将目录中的所有文件直接复制到目标,而不会将其放入子目录。This use of the wildcard character copies all of the files in a directory directly to the destination without placing them into a subdirectory.

  • 也可以在容器名称中使用通配符,前提是 URL 只引用容器而不引用 Blob。You can also a wildcard character in the name of a container as long as the URL refers only to a container and not to a blob. 可以使用此方法从一部分容器中获取文件。You can use this approach to obtain files from a subset of containers.

下载目录的内容,而不复制包含的目录本身。Download the contents of a directory without copying the containing directory itself.

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn/[container]/[path/to/folder]/*?[SAS]" "/path/to/dir"

下载整个存储帐户。Download an entire storage account.

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn/" "/path/to/dir" --recursive

在容器名称中使用通配符 (*),下载存储帐户中的一部分容器。Download a subset of containers within a storage account by using a wildcard symbol (*) in the container name.

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn/[container*name]" "/path/to/dir" --recursive

使用 SAS 令牌将单个 Blob 复制到另一个 Blob。Copy a single blob to another blob by using a SAS token.

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]" "https://[destaccount].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]"

使用 SAS 令牌和身份验证令牌将单个 Blob 复制到另一个 Blob。Copy a single blob to another blob by using a SAS token and an Auth token. 必须在源帐户 URL 的末尾使用 SAS 令牌,但如果使用 azcopy login 命令登录到 AzCopy,则目标帐户不需要 SAS 令牌。You have to use a SAS token at the end of the source account URL, but the destination account doesn't need one if you log into AzCopy by using the azcopy login command.

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]" "https://[destaccount].blob.core.chinacloudapi.cn/[container]/[path/to/blob]"

使用 SAS 令牌将一个 Blob 虚拟目录复制到另一个 Blob:Copy one blob virtual directory to another by using a SAS token:

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" "https://[destaccount].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive=true

使用 SAS 令牌将一个存储帐户中的所有 Blob 容器、目录和 Blob 复制到另一个存储帐户:Copy all blob containers, directories, and blobs from storage account to another by using a SAS token:

azcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn?[SAS]" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive

使用访问密钥和 SAS 令牌将单个对象复制到 Amazon Web Services (AWS) S3 中的 Blob 存储。Copy a single object to Blob Storage from Amazon Web Services (AWS) S3 by using an access key and a SAS token. 首先,为 AWS S3 源设置环境变量 AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYFirst, set the environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for AWS S3 source.

azcopy cp "https://s3.amazonaws.com/[bucket]/[object]" "https://[destaccount].blob.core.chinacloudapi.cn/[container]/[path/to/blob]?[SAS]"

使用访问密钥和 SAS 令牌将整个目录复制到 AWS S3 中的 Blob 存储。Copy an entire directory to Blob Storage from AWS S3 by using an access key and a SAS token. 首先,为 AWS S3 源设置环境变量 AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYFirst, set the environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for AWS S3 source.

azcopy cp "https://s3.amazonaws.com/[bucket]/[folder]" "https://[destaccount].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive

请参阅 https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-folders.html 以更好地了解 [folder] 占位符。Refer to https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-folders.html to better understand the [folder] placeholder.

使用访问密钥和 SAS 令牌将所有桶复制到 Amazon Web Services (AWS) 中的 Blob 存储。Copy all buckets to Blob Storage from Amazon Web Services (AWS) by using an access key and a SAS token. 首先,为 AWS S3 源设置环境变量 AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYFirst, set the environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for AWS S3 source.

azcopy cp "https://s3.amazonaws.com/" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive

使用访问密钥和 SAS 令牌将所有桶复制到 Amazon Web Services (AWS) 区域中的 Blob 存储。Copy all buckets to Blob Storage from an Amazon Web Services (AWS) region by using an access key and a SAS token. 首先,为 AWS S3 源设置环境变量 AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYFirst, set the environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for AWS S3 source.

- azcopy cp "https://s3-[region].amazonaws.com/" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive

在桶名称中使用通配符 (*) 来复制一部分桶。Copy a subset of buckets by using a wildcard symbol (*) in the bucket name. 如前面的示例所示,需要提供访问密钥和 SAS 令牌。Like the previous examples, you'll need an access key and a SAS token. 请确保为 AWS S3 源设置环境变量 AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYMake sure to set the environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for AWS S3 source.

- azcopy cp "https://s3.amazonaws.com/[bucket*name]/" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive

选项Options

--backup - 激活 Windows 用于上传的 SeBackupPrivilege 或用于下载的 SeRestorePrivilege,以允许 AzCopy 查看和读取所有文件(无论其文件系统权限如何),并恢复所有权限。--backup Activates Windows' SeBackupPrivilege for uploads, or SeRestorePrivilege for downloads, to allow AzCopy to see and read all files, regardless of their file system permissions, and to restore all permissions. 要求运行 AzCopy 的帐户已经具有这些权限(例如,拥有管理员权限,或者是 Backup Operators 组的成员)。Requires that the account running AzCopy already has these permissions (for example, has Administrator rights or is a member of the Backup Operators group). 此标志激活帐户已经具有的权限。This flag activates privileges that the account already has.

--blob-type 字符串 定义目标中的 Blob 类型。--blob-type string Defines the type of blob at the destination. 此选项用于上传 Blob 以及在帐户之间进行复制(默认值为 Detect)。This is used for uploading blobs and when copying between accounts (default Detect). 有效值包括 DetectBlockBlobPageBlobAppendBlobValid values include Detect, BlockBlob, PageBlob, and AppendBlob. 在帐户之间复制时,使用值 Detect 会导致 AzCopy 使用源 Blob 的类型来确定目标 Blob 的类型。When copying between accounts, a value of Detect causes AzCopy to use the type of source blob to determine the type of the destination blob. 上传文件时,Detect 会根据文件扩展名确定文件是 VHD 文件还是 VHDX 文件。When uploading a file, Detect determines if the file is a VHD or a VHDX file based on the file extension. 如果文件是 VHD 或 VHDX 文件,则 AzCopy 会将该文件视为页 Blob。If the file is ether a VHD or VHDX file, AzCopy treats the file as a page blob. (默认值为“Detect”)(default "Detect")

--block-blob-tier 字符串 - 使用此 blob 层将块 blob 上传到 Azure 存储。--block-blob-tier string Upload block blob to Azure Storage using this blob tier. (默认值为“None”)(default "None")

--block-size-mb 浮点数 - 在上传到 Azure 存储以及从 Azure 存储下载时使用此块大小(以 MiB 为单位)。--block-size-mb float Use this block size (specified in MiB) when uploading to Azure Storage, and downloading from Azure Storage. 默认值是根据文件大小自动计算的。The default value is automatically calculated based on file size. 允许使用小数(例如:0.25)。Decimal fractions are allowed (For example: 0.25).

--cache-control 字符串 - 设置 cache-control 标头。--cache-control string Set the cache-control header. 下载时返回。Returned on download.

--check-length - 传输后检查目标上的文件长度。--check-length Check the length of a file on the destination after the transfer. 如果源与目标之间不匹配,则将传输标记为失败。If there is a mismatch between source and destination, the transfer is marked as failed. (默认值为 true)。(default value is true)

--check-md5 字符串 - 指定下载时验证 MD5 哈希的严格程度。--check-md5 string Specifies how strictly MD5 hashes should be validated when downloading. 仅在下载时可用。Only available when downloading. 可用选项:NoCheckLogOnlyFailIfDifferent``FailIfDifferentOrMissingAvailable options: NoCheck, LogOnly, FailIfDifferent, FailIfDifferentOrMissing. (默认值为 FailIfDifferent)。(default FailIfDifferent) (default "FailIfDifferent")

--content-disposition 字符串 - 设置 content-disposition 标头。--content-disposition string Set the content-disposition header. 下载时返回。Returned on download.

--content-encoding 字符串 - 设置 content-encoding 标头。--content-encoding string Set the content-encoding header. 下载时返回。Returned on download.

--content-language 字符串 - 设置 content-language 标头。--content-language string Set the content-language header. 下载时返回。Returned on download.

--content-type 字符串 - 指定文件的内容类型。--content-type string Specifies the content type of the file. 暗指 no-guess-mime-type。Implies no-guess-mime-type. 下载时返回。Returned on download.

--decompress - 下载时自动解压缩文件(如果 content-encoding 指示文件已压缩)。--decompress Automatically decompress files when downloading, if their content-encoding indicates that they are compressed. 支持的 content-encoding 值为 gzipdeflateThe supported content-encoding values are gzip and deflate. 不需要提供 .gz/.gzip.zz 文件扩展名,但如果存在,则将其删除。File extensions of .gz/.gzip or .zz aren't necessary, but will be removed if present.

--exclude-attributes 字符串 -(仅限 Windows)排除其属性与属性列表相匹配的文件。--exclude-attributes string (Windows only) Excludes files whose attributes match the attribute list. 例如:A;S;RFor example: A;S;R

--exclude-blob-type 字符串 -(可选)指定从容器或帐户复制 Blob 时要排除的 Blob 类型 (BlockBlob/ PageBlob/ AppendBlob)。--exclude-blob-type string Optionally specifies the type of blob (BlockBlob/ PageBlob/ AppendBlob) to exclude when copying blobs from the container or the account. 此标志不适用于将数据从非 Azure 服务复制到 Azure 服务。Use of this flag is not applicable for copying data from non-Azure service to service. 应使用 ; 分隔多个 Blob。More than one blob should be separated by ;.

--exclude-path 字符串 - 复制时排除这些路径。--exclude-path string Exclude these paths when copying. 此选项不支持通配符 (*)。This option does not support wildcard characters (*). 检查相对路径前缀(例如:myFolder;myFolder/subDirName/file.pdf)。Checks relative path prefix(For example: myFolder;myFolder/subDirName/file.pdf). 与帐户遍历结合使用时,路径不包含容器名称。When used in combination with account traversal, paths do not include the container name.

--exclude-pattern 字符串 - 复制时排除这些文件。--exclude-pattern string Exclude these files when copying. 此选项支持通配符 (*)。This option supports wildcard characters (*).

--follow-symlinks - 从本地文件系统上传时遵循符号链接。--follow-symlinks Follow symbolic links when uploading from local file system.

--force-if-read-only - 在 Windows 或 Azure 文件上覆盖现有文件时,即使现有文件已设置只读属性,也要执行覆盖操作。--force-if-read-only When overwriting an existing file on Windows or Azure Files, force the overwrite to work even if the existing file has its read-only attribute set.

--from-to 字符串 -(可选)指定源目标组合。--from-to string Optionally specifies the source destination combination. 例如:LocalBlobBlobLocalLocalBlobFSFor Example: LocalBlob, BlobLocal, LocalBlobFS.

- copy 命令的帮助。--help help for copy.

--include-after 字符串 - 只包括在给定日期/时间或之后修改的文件。--include-after string Include only those files modified on or after the given date/time. 该值应为 ISO8601 格式。The value should be in ISO8601 format. 如果未指定时区,则假定该值位于运行 AzCopy 的计算机的本地时区中。If no timezone is specified, the value is assumed to be in the local timezone of the machine running AzCopy. 例如,2020-08-19T15:04:00Z 表示 UTC 时间,2020-08-19 表示本地时区的午夜 (00:00)。for example, 2020-08-19T15:04:00Z for a UTC time, or 2020-08-19 for midnight (00:00) in the local timezone. 与 AzCopy 10.5 一样,此标志仅适用于文件,不适用于文件夹,因此当将此标志与 --preserve-smb-info--preserve-smb-permissions 一起使用时,将不会复制文件夹属性。As at AzCopy 10.5, this flag applies only to files, not folders, so folder properties won't be copied when using this flag with --preserve-smb-info or --preserve-smb-permissions.

--include-attributes 字符串 -(仅限 Windows)包括其属性与属性列表相匹配的文件。--include-attributes string (Windows only) Includes files whose attributes match the attribute list. 例如:A;S;RFor example: A;S;R

--include-path 字符串 - 复制时仅包括这些路径。--include-path string Include only these paths when copying. 此选项不支持通配符 (*)。This option does not support wildcard characters (*). 检查相对路径前缀(例如:myFolder;myFolder/subDirName/file.pdf)。Checks relative path prefix (For example: myFolder;myFolder/subDirName/file.pdf).

--include-pattern 字符串 - 复制时仅包括这些文件。--include-pattern string Include only these files when copying. 此选项支持通配符 (*)。This option supports wildcard characters (*). 使用 ; 分隔文件。Separate files by using a ;.

--log-level 字符串 - 定义日志文件的日志详细程度,可用级别:INFO(所有请求/响应)、WARNING(响应缓慢)、ERROR(仅限失败的请求)和 NONE(无输出日志)。--log-level string Define the log verbosity for the log file, available levels: INFO(all requests/responses), WARNING(slow responses), ERROR(only failed requests), and NONE(no output logs). (默认值为 INFO)。(default INFO).

--metadata 字符串 - 将这些键值对作为元数据上传到 Azure 存储。--metadata string Upload to Azure Storage with these key-value pairs as metadata.

--no-guess-mime-type - 阻止 AzCopy 根据文件的扩展名或内容来检测内容类型。--no-guess-mime-type Prevents AzCopy from detecting the content-type based on the extension or content of the file.

--overwrite 字符串 - 如果此标志设置为 true,则会覆盖目标上有冲突的文件和 Blob。--overwrite string Overwrite the conflicting files and blobs at the destination if this flag is set to true. (默认值为 true)可能的值包括:truefalsepromptifSourceNewer(default true) Possible values include true, false, prompt, and ifSourceNewer. 对于支持文件夹的目标,冲突的文件夹级别属性将被覆盖,此标志为 true 或对提示提供肯定的响应。For destinations that support folders, conflicting folder-level properties will be overwritten this flag is true or if a positive response is provided to the prompt. (默认值为“true”)(default "true")

--page-blob-tier 字符串 - 使用此 blob 层将页 blob 上传到 Azure 存储。--page-blob-tier string Upload page blob to Azure Storage using this blob tier. (默认值为 None)。(default None). (默认值为“None”)(default "None")

--preserve-last-modified-time - 仅当目标为文件系统时才可用。--preserve-last-modified-time Only available when destination is file system.

--preserve-owner - 仅当下载时,且仅当使用 --preserve-smb-permissions 时才起作用。--preserve-owner Only has an effect in downloads, and only when --preserve-smb-permissions is used. 如果为 true(默认值),则下载内容中将保留文件“所有者”和“组”。If true (the default), the file Owner and Group are preserved in downloads. 如果设置为 false,则 --preserve-smb-permissions 仍保留 ACL,但“所有者”和“组”的保留将基于运行 AzCopy 的用户(默认值为 true)。If set to false,--preserve-smb-permissions will still preserve ACLs but Owner and Group will be based on the user running AzCopy (default true)

--preserve-smb-info - 默认值为 False。--preserve-smb-info False by default. 保留 SMB 感知资源(Windows 和 Azure 文件存储)之间的 SMB 属性信息(上次写入时间、创建时间、属性位)。Preserves SMB property info (last write time, creation time, attribute bits) between SMB-aware resources (Windows and Azure Files). 只会传输 Azure 文件存储支持的属性位;其他的将被忽略。Only the attribute bits supported by Azure Files will be transferred; any others will be ignored. 此标志同时适用于文件和文件夹,除非指定了“仅文件”筛选器(例如包含模式)。This flag applies to both files and folders, unless a file-only filter is specified (for example, include-pattern). 为文件夹传输的信息与为文件传输的信息几乎相同,只是“上次写入时间”除外,不会为文件夹保留该信息。The info transferred for folders is the same as that for files, except for Last Write Time that is never preserved for folders.

--preserve-smb-permissions - 默认值为 False。--preserve-smb-permissions False by default. 保留感知资源(Windows 和 Azure 文件存储)之间的 SMB ACl。Preserves SMB ACLs between aware resources (Windows and Azure Files). 对于下载操作,还需要使用 --backup 标志来恢复权限,其中新所有者将不是运行 AzCopy 的用户。For downloads, you will also need the --backup flag to restore permissions where the new Owner will not be the user running AzCopy. 此标志同时适用于文件和文件夹,除非指定了“仅文件”筛选器(例如 include-pattern)。This flag applies to both files and folders, unless a file-only filter is specified (for example, include-pattern).

--put-md5 - 创建每个文件的 MD5 哈希,并将该哈希另存为目标 Blob 或文件的 Content-MD5 属性。--put-md5 Create an MD5 hash of each file, and save the hash as the Content-MD5 property of the destination blob or file. (默认不会创建哈希。)仅在上传时可用。(By default the hash is NOT created.) Only available when uploading.

--recursive - 从本地文件系统上传时以递归方式检查子目录。--recursive Look into subdirectories recursively when uploading from local file system.

--s2s-detect-source-changed - 检测源文件/blob 在读取时是否发生更改。--s2s-detect-source-changed Detect if the source file/blob changes while it is being read. (此参数仅适用于服务到服务的副本,因为将对上传和下载永久启用相应的检查。)(This parameter only applies to service-to-service copies, because the corresponding check is permanently enabled for uploads and downloads.)

--s2s-handle-invalid-metadata 字符串 指定如何处理无效的元数据键。--s2s-handle-invalid-metadata string Specifies how invalid metadata keys are handled. 可用选项:ExcludeIfInvalid、FailIfInvalid、RenameIfInvalid。Available options: ExcludeIfInvalid, FailIfInvalid, RenameIfInvalid. (默认值为 ExcludeIfInvalid)。(default ExcludeIfInvalid). (默认值为“ExcludeIfInvalid”)(default "ExcludeIfInvalid")

--s2s-preserve-access-tier - 在服务之间复制过程中保留访问层--s2s-preserve-access-tier Preserve access tier during service to service copy. 请参阅 Azure Blob 存储:热、冷和存档访问层,确保目标存储帐户支持设置访问层。Refer to Azure Blob storage: hot, cool, and archive access tiers to ensure destination storage account supports setting access tier. 如果不支持设置访问层,请使用 s2sPreserveAccessTier=false 来绕过访问层的复制。In the cases that setting access tier is not supported, use s2sPreserveAccessTier=false to bypass copying access tier. (默认值为 true)。(default true). (默认值为“true”)(default "true")

--s2s-preserve-properties - 在服务之间复制过程中保留完整属性。--s2s-preserve-properties Preserve full properties during service to service copy. 对于 AWS S3 和 Azure 文件存储的非单一文件源,列出操作不会返回对象和文件的完整属性。For AWS S3 and Azure File non-single file source, the list operation doesn't return full properties of objects and files. 若要保留完整属性,AzCopy 需要对每个对象或文件发送一个附加的请求。To preserve full properties, AzCopy needs to send one additional request per object or file. (默认值为 true)(default true)

从父命令继承的选项Options inherited from parent commands

--cap-mbps 浮点数 - 以兆位/秒为单位限制传输速率。--cap-mbps float Caps the transfer rate, in megabits per second. 瞬间吞吐量可能与上限略有不同。Moment-by-moment throughput might vary slightly from the cap. 如果此选项设置为零,或者省略,则吞吐量不受限制。If this option is set to zero, or it is omitted, the throughput isn't capped.

--output-type 字符串 命令输出的格式。--output-type string Format of the command's output. 选项包括:text、json。The choices include: text, json. 默认值为 textThe default value is text. (默认值为“text”)(default "text")

--trusted-microsoft-suffixes 字符串指定可向其中发送 Azure Active Directory 登录令牌的其他域后缀。--trusted-microsoft-suffixes string Specifies additional domain suffixes where Azure Active Directory login tokens may be sent. 默认为 *.core.windows.net;*.core.chinacloudapi.cn;*.core.cloudapi.de;*.core.usgovcloudapi.netThe default is *.core.windows.net;*.core.chinacloudapi.cn;*.core.cloudapi.de;*.core.usgovcloudapi.net. 此处列出的任何内容都会添加到默认值。Any listed here are added to the default. 为安全起见,应只在此处放置 Azure 域。For security, you should only put Azure domains here. 用分号分隔多个条目。Separate multiple entries with semi-colons.

另请参阅See also