2

我有大量的对象存储在 Minio 中。我需要将它们从一个桶移到另一个桶。由于对象的数量很大(以及对象本身的大小),我不想将它们上传到内存中。

到目前为止,我发现的唯一方法是将对象复制到目标存储桶并将它们从源存储桶中删除。

有没有办法用一个命令(比如mv)移动它们?

4

2 回答 2

4

@yaskovdev S3 API 不允许mv类似的功能。因此,您描述的步骤是执行此操作的唯一方法。

于 2018-08-13T18:58:27.797 回答
4

自 2020 年 4 月以来,minio 客户端实用程序确实支持移动功能:

$ mc mv -h
NAME:
  mc mv - move objects

USAGE:
  mc mv [FLAGS] SOURCE [SOURCE...] TARGET

FLAGS:
  --recursive, -r                    move recursively
  --older-than value                 move objects older than L days, M hours and N minutes
  --newer-than value                 move objects newer than L days, M hours and N minutes
  --storage-class value, --sc value  set storage class for new object(s) on target
  --encrypt value                    encrypt/decrypt objects (using server-side encryption with server managed keys)
  --attr value                       add custom metadata for the object
  --continue, -c                     create or resume move session
  --preserve, -a                     preserve filesystem attributes (mode, ownership, timestamps)
  --disable-multipart                disable multipart upload feature
  --encrypt-key value                encrypt/decrypt objects (using server-side encryption with customer provided keys)
  --config-dir value, -C value       path to configuration folder (default: "/Users/prerok/.mc")
  --quiet, -q                        disable progress bar display
  --no-color                         disable color theme
  --json                             enable JSON formatted output
  --debug                            enable debug output
  --insecure                         disable SSL certificate verification
  --help, -h                         show help

S3 API 不支持移动功能,因此 mc 实用程序实际上是先进行复制,然后再删除对象。来源: https ://github.com/minio/mc/blob/133dd1f7da237a91dc291cbf8f3a5ad66fffc425/cmd/mv-main.go#L363

于 2020-06-15T14:02:47.977 回答