mc cp

Copies objects to and from buckets on local cluster or remote fabric in the global namespace.

Syntax

NOTE
The size limits for an object to upload are as follows.

Single object put : 5 GiB

Single part size : 5 GiB

Multi part complete object size : 5 TiB

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

FLAGS:
  --version-id value, --vid value    select an object version to copy
  --recursive, -r                    copy recursively
  --attr value                       add custom metadata for the object
  --preserve, -a                     preserve filesystem attributes (mode, ownership, timestamps)
  --disable-multipart                disable multipart upload feature
  --md5                              force all upload(s) to calculate md5sum checksum
  --retention-mode value             retention mode to be applied on the object (governance, compliance)
  --retention-duration value         retention duration for the object in d days or y years
  --legal-hold value                 apply legal hold to the copied object (on, off)
  --tags value                       add tags for the object
  --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 copied. This can be the filesystem or the alias of a configured HPE Ezmeral Object Store deployment. This parameter is mandatory. To copy 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.
TARGET The destination to which an object is copied. This can be the filesystem or the alias of a configured HPE Ezmeral Object Store deployment. This parameter is mandatory. To copy 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>-<clustername>/<objectname>.When bucketname and objectname is mentioned without the fabric name, Data Fabric checks the local cluster for the specified bucketname and objectname.
version-id The object version to copy.
recursive Copy 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 copying.
disable-multipart Disable the multipart upload feature.
md5 Calculate the md5 checksum when uploading.
retention-mode The retention mode - either governance or compliance - to apply to the object.
retention-duration Set the duration of the retention mode in days (d) or years (y).
legal-hold Set legal hold for the object.
tags Add tags for the object.
json Enable JSON formatted output.
debug Enable output for debugging.
insecure Disable SSL verification.
help Show this help.

Examples

  1. Copy local folders fin1 and fin2 recursively to a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc cp --recursive fin1/ fin2/ salesobject/northamerica/
  2. Copy 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 cp --attr "key1=value1;key2=value2" profit/*.xls salesobject/northamerica/
  3. Copy the file secret.txt with object lock mode set to governance with retention duration 1 day, from the profit folder to a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc cp --retention-mode governance --retention-duration 1d profit/secret.txt salesobject/northamerica/
  4. Copy the file secret.txt with legal hold enabled, from the profit folder to a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc cp --legal-hold on profit/secret.txt salesobject/northamerica/
  5. Copy the file secret.txt with legal hold enabled, from the profit folder to a bucket named northamerica on a remote cluster named sales, in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc cp --legal-hold on profit/secret.txt salesobject/sales-northamerica/
  6. Copy the object testobject from the usa bucket on the remote fabric sales to a bucket named northamerica on the same remote fabric sales, in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc cp salesobject/sales-usa/testobject salesobject/sales-northamerica/