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)
  • 本地 <-> ADLS Gen 2(SAS、OAuth 或共享密钥身份验证)local <-> ADLS Gen 2 (SAS, OAuth, or SharedKey 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)
  • AWS S3(访问密钥)-> Azure 块 Blob(SAS 或 OAuth 身份验证)AWS S3 (Access Key) -> Azure Block Blob (SAS or OAuth authentication)

有关详细信息,请参阅示例。Please refer to the examples for more information.

高级Advanced

从本地磁盘上传时,AzCopy 会根据文件扩展名或内容(如果未指定扩展名)自动检测文件的内容类型。AzCopy automatically detects the content type of the files when uploading from the local disk, 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 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. 请参阅“标志”部分。Please refer to the flag section.

如果使用命令行设置环境变量,则可以在命令行历史记录中读取该变量。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, please 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]"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-md5azcopy 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]"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]"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=trueazcopy cp "/path/to/dir" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive=true

or

  • azcopy cp "/path/to/dir" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive=true --put-md5azcopy cp "/path/to/dir" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive=true --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]"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=trueazcopy cp "/path/foo/ bar*" "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive=true

使用 OAuth 身份验证下载单个文件。Download a single file by using OAuth authentication. 如果尚未登录到 AzCopy,请在运行以下命令之前运行 azcopy login 命令。If you have not yet logged into AzCopy, please 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"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"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"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=trueazcopy cp "https://[account].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" "/path/to/dir" --recursive=true

有关在 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 copies all of the files in a directory directly to the destination without placing them into a subdirectory.

  • 也可以在容器名称中使用一个通配符,前提是 URL 只引用容器而不引用 Blob。You can also use one 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"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" --recursiveazcopy 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" --recursiveazcopy 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]"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 令牌和 OAuth 令牌将单个 Blob 复制到另一个 Blob。Copy a single blob to another blob by using a SAS token and an OAuth 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]"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=trueazcopy 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=trueazcopy cp "https://[srcaccount].blob.core.chinacloudapi.cn?[SAS]" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive=true

使用访问密钥和 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_ID 和 AWS_SECRET_ACCESS_KEY。First, 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]"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_ID 和 AWS_SECRET_ACCESS_KEY。First, 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=trueazcopy cp "https://s3.amazonaws.com/[bucket]/[folder]" "https://[destaccount].blob.core.chinacloudapi.cn/[container]/[path/to/directory]?[SAS]" --recursive=true

请参阅 https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-folders.html 以更好地了解 [folder] 占位符。Please 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_ID 和 AWS_SECRET_ACCESS_KEY。First, 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=trueazcopy cp "https://s3.amazonaws.com/" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive=true

使用访问密钥和 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_ID 和 AWS_SECRET_ACCESS_KEY。First, 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=trueazcopy cp "https://s3-[region].amazonaws.com/" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive=true

在桶名称中使用通配符 (*) 来复制一部分桶。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_ID 和 AWS_SECRET_ACCESS_KEY。Make 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=trueazcopy cp "https://s3.amazonaws.com/[bucket*name]/" "https://[destaccount].blob.core.chinacloudapi.cn?[SAS]" --recursive=true

选项Options

--backup 激活 Windows 用于上传的 SeBackupPrivilege 或用于下载的 SeRestorePrivilege,以允许 AzCopy 查看和读取所有文件(无论其文件系统权限如何),并恢复所有权限。--backup Activates Windows' SeBackupPrivilege for uploads, or SeRestorePrivilege for downloads, to allow AzCopy to see read all files, regardless of their file system permissions, and to restore all permissions. 要求运行 AzCopy 的帐户已经具有这些权限(例如,拥有管理员权限,或者是“备份操作员”组的成员)。Requires that the account running AzCopy already has these permissions (e.g. has administrator rights or is a member of the 'Backup Operators' group). 此标志的功能就是激活帐户已经具有的权限。All this flag does is activate 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'). 有效值包括“Detect”、“BlockBlob”、“PageBlob”和“AppendBlob”。Valid 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 直接上传到所选的访问层--block-blob-tier string Upload block blobs directly to the access tier of your choice. (默认值为“None”)。(default 'None'). 有效值包括“None”、“Hot”、“Cool”和“Archive”。Valid values include 'None', 'Hot', 'Cool', and 'Archive'. 如果传递“None”或未传递任何层,则 blob 将继承存储帐户的层。If 'None' or no tier is passed, the blob will inherit the tier of the storage account.

--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 true)

--check-md5 字符串 指定下载时验证 MD5 哈希的严格程度。--check-md5 string Specifies how strictly MD5 hashes should be validated when downloading. 仅在下载时可用。Only available when downloading. 可用选项:NoCheck、LogOnly、FailIfDifferent、FailIfDifferentOrMissing。Available options: NoCheck, LogOnly, FailIfDifferent, FailIfDifferentOrMissing. (默认值为“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 值为“gzip”和“deflate”。The 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) Exclude 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.

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

-h、--help copy 命令的帮助-h, --help help for copy

--include-attributes 字符串 (仅限 Windows)包括其属性与属性列表相匹配的文件。--include-attributes string (Windows only) Include 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”、“false”、“ifSourceNewer”和“prompt”。Possible values include 'true', 'false', 'ifSourceNewer', and '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")

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

--preserve-smb-permissions 字符串 默认值为 False。--preserve-smb-permissions string 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 to use the --backup flag to restore permissions where the new Owner will not be the user that is running AzCopy. 此标志同时适用于文件和文件夹,除非指定了“仅文件”筛选器(例如 include-pattern)。This flag applies to both files and folders, unless a file-only filter is specified (e.g. include-pattern).

--preserve-smb-info 字符串 默认值为 False。--preserve-smb-info string 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 (e.g. include-pattern). 为文件夹传输的信息与为文件传输的信息几乎相同,只是“上次写入时间”除外,不会为文件夹保留该信息。The information transferred for folders is the same as that for files, except for Last Write Time which is never preserved for folders.

--preserve-owner 仅当下载数据时,且仅当使用 --preserve-smb-permissions 时才起作用。--preserve-owner Only has an effect in when downloading data, and only when the --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 的用户。If this flag is set to false, --preserve-smb-permissions will still preserve ACLs but Owner and Group will be based on the user that is running AzCopy.

--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 sub-directories recursively when uploading from local file system.

--s2s-detect-source-changed 检查源在枚举后是否已更改。--s2s-detect-source-changed Check if source has changed after enumerating.

--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")

--s2s-preserve-access-tier 在服务之间复制过程中保留访问层--s2s-preserve-access-tier Preserve access tier during service to service copy. 请参阅 Azure Blob 存储:热、冷和存档访问层,确保目标存储帐户支持设置访问层。Please 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, please use s2sPreserveAccessTier=false to bypass copying access tier. (默认值为 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 uint32 以兆位/秒为单位限制传输速率。--cap-mbps uint32 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. 默认值为“text”。The 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.net” 。The 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