mc mv

Move objects between buckets.

Syntax

CLI
mc mv [FLAGS] SOURCE [SOURCE...] TARGET

FLAGS:
  --recursive, -r      move recursively
  --attr value         add custom metadata for the object
  --preserve, -a       preserve filesystem attributes (mode, ownership, timestamps)
  --disable-multipart  disable multipart upload feature
  --json               enable JSON lines formatted output
  --debug              enable debug output
  --insecure           disable SSL certificate verification
  --help, -h           show help

Parameters

Parameter Description
SOURCE The source from which an object is moved. This can be the filesystem or the alias of a configured HPE Ezmeral Object Store deployment. This parameter is mandatory. To move objects from a remote cluster/fabric in the global namespace, use the format <fabricname>-<bucketname>/<objectname> instead of only the <bucketname>/<objectname>. When bucketname and objectname is mentioned without the fabric name, Data Fabric checks the local cluster for the specified objectname.
TARGET The destination to which an object is moved. This can be the filesystem or the alias of a configured HPE Ezmeral Object Store deployment. This parameter is mandatory. To move objects from a remote cluster/fabric in the global namespace, use the format <fabricname>-<bucketname>/<objectname> instead of only the <bucketname>/<objectname> after the alias, that is <alias>/<fabricname>-<bucketname>/<objectname>.When bucketname and objectname is mentioned without the fabric name, Data Fabric checks the local cluster for the specified bucketname and objectname.
recursive Move objects recursively and not just the top-level folder.
attr Add custom metadata for the object.
preserve Preserve filesystem attributes such as mode, timestamps and ownership when moving.
disable-multipart Disable the multipart upload feature.
json Enable JSON formatted output.
debug Enable output for debugging.
insecure Disable SSL verification.
help Show this help.

Examples

  1. Move local folders fin1 and fin2 recursively to a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc mv --recursive fin1/ fin2/ salesobject/northamerica/
  2. Move a list of Excel files (.xls) with specified metadata, separated by ";" from the profit folder to a bucket named northamerica in the Object Store deployment with alias salesobject
    CLI
    /opt/mapr/bin/mc mv --attr "key1=value1;key2=value2" profit/*.xls salesobject/northamerica/
  3. Move a file named secret.txt with attributes preserved from the profit folder to a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc mv --preserve profit/secret.txt salesobject/northamerica/
  4. Move a file named secret.txt with attributes preserved from the profit folder to a bucket named northamerica in a remote cluster named sales in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc mv --preserve profit/secret.txt salesobject/sales-northamerica/