如何将物体从一个铲斗移动到另一个铲斗?

时间:2018-08-03 08:47:37

标签: minio

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

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

是否可以通过一个命令(例如mv)移动它们?

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:2)

自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

相关问题