Skip to content

This is the multi-page printable view of this section. .

Return to the regular view of this page.

Silo Client (mcli / mc)

The Pigsty-maintained client is distributed as mcli in standalone archives and Linux packages. Its source build, container entrypoint, configuration directory, module path, and command syntax retain mc for compatibility. It provides familiar commands such as ls, cat, cp, mirror, and diff for filesystems and Amazon S3-compatible object storage.

The mc command-line tool is built for compatibility with the AWS S3 API. Its current source retains compatibility with Silo, upstream MinIO, and AWS S3.

The Silo project cannot guarantee behavior against every other S3-compatible service because implementations differ. Test the operations your workload relies on before treating another service as compatible.

mc has the following syntax:

mc [GLOBALFLAGS] COMMAND --help

See Command Quick Reference for a list of supported commands.

Version Alignment with Silo Server

The client releases separately from the Silo server.

For best functionality and compatibility, use a client version released close to your Silo or MinIO server version. A client released on the same day or later than the server is generally the safer choice.

You can install a client newer than the server. If the versions skew too far apart, however, administrative features or flags may differ even when core S3 operations such as mc cp remain compatible.

Quickstart

1) Install the client

Use Download & Install to select a Linux package, an archive for Linux, macOS, or Windows, or the client container. Versioned artifacts and checksums are also available from GitHub Releases.

Standalone archives and Linux packages install the command as mcli. The container and source build retain mc. The commands are aliases of the same client; when this reference shows mc, substitute mcli if that is the name installed on your host.

To build the maintained fork from source:

git clone https://github.com/pgsty/mc.git
cd mc
make build
./mc --version
Warning

mc update is intentionally disabled in the Pigsty fork. Upgrade through the Silo download page, the Pigsty package repository, or GitHub Releases.

Note

The current pgsty/mc source still registers the mc license and mc support command trees. Those commands integrate with upstream MinIO SUBNET and its commercial licensing/support service; they are not Silo services. Their command names, protocol fields, SUBNET wording, and MinIO pricing/license links are retained as upstream contracts and must not be rebranded.

2) Create an Alias for the S3-Compatible Service

Warning

Important

The following example temporarily disables the bash history to mitigate the risk of authentication credentials leaking in plain text. This is a basic security measure and does not mitigate all possible attack vectors. Defer to security best practices for your operating system for inputting sensitive information on the command line.

Use the mc alias set command to add an Amazon S3-compatible service to the mc configuration.

bash +o history
mc alias set ALIAS HOSTNAME ACCESS_KEY SECRET_KEY
bash -o history
  • Replace ALIAS with a name to associate to the S3 service. mc commands typically require ALIAS as an argument for identifying which S3 service to execute against.
  • Replace HOSTNAME with the URL endpoint or IP address of the S3 service.
  • Replace ACCESS_KEY and SECRET_KEY with the access and secret keys for a user on the S3 service.

Replace each argument with the required values. If you omit the ACCESS_KEY and SECRET_KEY, the command prompts you to enter those values in the CLI.

Each of the following tabs contains a provider-specific example:

Silo Server
mc alias set silo https://silo.example.net ACCESS_KEY SECRET_KEY
AWS S3 Storage
mc alias set myS3 https://s3.{your-region-code}.amazonaws.com/endpoint ACCESS_KEY SECRET_KEY
Google Cloud Storage
mc alias set myGCS https://storage.googleapis.com/endpoint ACCESS_KEY SECRET_KEY

3) Test the Connection

Use the mc admin info command to test the connection to the newly added Silo deployment:

mc admin info silo

The command returns information on the S3 service if successful. If unsuccessful, check each of the following:

  • The host machine has connectivity to the S3 service URL (i.e. using ping or traceroute).

  • The specified ACCESSKEY and SECRETKEY correspond to a user on the S3 service. The user must have permission to perform actions on the service.

    For MinIO deployments, see Access Management for more information on user access permissions. For other S3-compatible services, defer to the documentation for that service.

Command Quick Reference

The following table lists mc commands:

Note

Note

The client also includes an administration extension for managing Silo and compatible MinIO deployments. See mc admin for more complete documentation.

The below table does not include those commands.

Command

Description

mc alias list
mc alias remove
mc alias set
mc alias import
mc alias export

The mc alias commands provide a convenient interface for managing the list of S3-compatible hosts that mc can connect to and run operations against.

mc anonymous get
mc anonymous get-json
mc anonymous links
mc anonymous list
mc anonymous set
mc anonymous set-json

The mc anonymous command supports setting or removing anonymous policies to a bucket and its contents. Buckets with anonymous policies allow public access where clients can perform any action granted by the policy without authentication.

mc batch describe
mc batch generate
mc batch list
mc batch start
mc batch status

The mc batch commands allow you to run one or more job tasks on a MinIO deployment.

mc cat

The mc cat command concatenates the contents of a file or object to another file or object. You can also use the command to display the contents of the specified file or object to STDOUT. cat has similar functionality to cat.

mc cp

The mc cp command copies objects to or from a MinIO deployment, where the source can MinIO or a local filesystem.

mc diff

The mc diff mc computes the differences between two filesystem directories or MinIO buckets. mc diff lists only those objects which are missing or which differ in size. mc diff does not compare the contents of objects.

mc du

The mc du command summarizes the disk usage of buckets and folders. You can also use du against the local filesystem to produce similar results as the du command.

mc encrypt clear
mc encrypt info
mc encrypt set

The mc encrypt commands set, update, or disable the default bucket Server-Side Encryption (SSE) mode. MinIO automatically encrypts objects using the specified SSE mode.

mc event add
mc event ls
mc event rm

The mc event command supports adding, removing, and listing bucket event notifications.

mc find

The mc find command supports searching for objects on a MinIO deployment. You can also use the command to search for files on a filesystem.

mc get

The mc get command downloads an object from a target S3 deployment to the local file system.

mc head

The mc head command displays the first n lines of an object, where n is an argument specified to the command.

mc idp ldap accesskey
mc idp ldap accesskey create-with-login
mc idp ldap add
mc idp ldap disable
mc idp ldap enable
mc idp ldap info
mc idp ldap ls
mc idp ldap policy
mc idp ldap rm
mc idp ldap update

The mc idp ldap commands allow you to manage configurations to 3rd party Active Directory or LDAP Identity and Access Management (IAM) integrations.

mc idp openid add
mc idp openid disable
mc idp openid enable
mc idp openid info
mc idp openid ls
mc idp openid rm
mc idp openid update

The mc idp openid commands allow you to manage configurations to 3rd party OpenID Identity and Access Management (IAM) integrations.

mc idp ldap policy attach
mc idp ldap policy detach
mc idp ldap policy entities

The mc idp ldap policy commands show the mapping relationships between policies and the associated groups or users.

mc ilm restore
mc ilm rule add
mc ilm rule edit
mc ilm rule export
mc ilm rule import
mc ilm rule ls
mc ilm rule rm
mc ilm tier add
mc ilm tier check
mc ilm tier info
mc ilm tier ls
mc ilm tier rm
mc ilm tier update

The mc ilm commands manage object lifecycle management rules and tiering on a MinIO deployment.

mc legalhold clear
mc legalhold info
mc legalhold set

The mc legalhold command sets, removes, or retrieves the object legal hold (WORM) settings for object(s).

mc license info
mc license register
mc license update

The mc license commands work with cluster registration for MinIO SUBNET. Use the commands to register a deployment, display information about the cluster’s current license, or update the license key for a cluster.

mc ls

The mc ls command lists buckets and objects on MinIO or another S3-compatible service.

mc mb

The mc mb command creates a new bucket or directory at the specified path.

mc mirror

The mc mirror command synchronizes content to MinIO deployment, similar to the rsync utility. mc mirror supports filesystems, MinIO deployments, and other S3-compatible hosts as the synchronization source.

mc mv

The mc mv command moves an object from source to the target, such as between MinIO deployments or between buckets on the same MinIO deployment. mc mv also supports moving objects between a local filesystem and MinIO.

mc od

The mc od command copies a local file to a remote location in a specified number of parts and part sizes. The command outputs the time it took to upload the file.

mc ping

The mc ping command performs a liveness check on a specified target.

mc pipe

The mc pipe command streams content from STDIN to a target object.

mc put

The mc put uploads an object from the local file system to a bucket on a target S3 deployment.

mc rb

The mc rb command removes one or more buckets on MinIO or another S3-compatible service.

To remove only the contents of a bucket, use mc rm instead.

mc ready

The mc ready command checks the status of a cluster and whether the cluster has read and write quorum.

mc replicate add
mc replicate backlog
mc replicate export
mc replicate import
mc replicate ls
mc replicate resync
mc replicate rm
mc replicate status
mc replicate update

The mc replicate command configures and manages the Server-Side Bucket Replication for a MinIO deployment, including active-active replication configurations and resynchronization.

mc retention clear
mc retention info
mc retention set

The mc retention command configures the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also set the default object lock settings for a bucket, where all objects without explicit object lock settings inherit the bucket default.

mc rm

The mc rm command removes objects from a bucket on a MinIO deployment. To completely remove a bucket, use mc rb instead.

mc share download
mc share ls
mc share upload

Use the mc share commands to manage presigned URLs for downloading and uploading objects to a MinIO bucket.

mc sql

The mc sql command provides an S3 Select interface for performing sql queries on objects in the specified MinIO deployment.

mc stat

The mc stat command displays information on objects in a MinIO bucket, including object metadata. You can also use it to retrieve bucket metadata.

mc support callhome
mc support diag
mc support inspect
mc support perf
mc support profile
mc support proxy
mc support top api
mc support top disk
mc support top locks
mc support upload

The MinIO Client mc support commands provides tools for analyzing deployment health or performance and for running diagnostics. You can also upload generated health reports for further analysis by MinIO engineering.

mc tag list
mc tag remove
mc tag set

The mc tag command adds, removes, and lists tags associated to a bucket or object.

mc tree

The mc tree command lists all prefixes inside a MinIO bucket in a tree format. The command optionally supports listing all objects inside of bucket at each prefix, including the bucket root.

mc undo

The mc undo command reverses changes due to either a PUT or DELETE operation at a specified path.

mc update

The mc update compatibility command reports that self-update is disabled. Upgrade through the Silo download page, the Pigsty package repository, or GitHub Releases.

mc version enable
mc version info
mc version suspend

The mc version commands enable, disable, and retrieve the versioning status for a MinIO bucket.

mc watch

The mc watch command watches for events on the specified MinIO bucket or local filesystem path. For S3 services, use mc event add to configure bucket event notifications on S3-compatible services.

Configuration File

mc uses a JSON formatted configuration file used for storing certain kinds of information, such as the aliases for each configured S3-compatible service.

For Linux and macOS, the default configuration file location is ~/.mc/config.json.

For Windows, mc attempts to construct a default file path by trying specific environment variables. If a variable is unset, mc moves to the next variable. If all attempts fail, mc returns an error. The following list describes each possible file path location in the order mc checks them:

  1. HOME\.mc\config.json
  2. USERPROFILE\.mc\config.json
  3. HOMEDRIVE+HOMEPATH\.mc\config.json

You can use the --config-dir

Certificates

The MinIO Client stores certificates and CAs for deployments to the following paths:

Linux, macOS, and other Unix-like systems:

~/.mc/certs/ # certificates
~/.mc/certs/CAs/ # Certificate Authorities

Windows systems:

C:\Users\[username]\mc\certs\ # certificates
C:\Users\[username]\mc\certs\CAs\ # Certificate Authorities

When creating a new alias, the MinIO Client fetches the peer certificate, computes the public key fingerprint, and asks the user whether to accept the deployment’s certificate. If you decide to trust the certificate, the MinIO Client adds the certificate to the certificate authority path listed above.

Note

Note

In testing environments, you can bypass the certificate check for selected MinIO Client commands by passing the --insecure flag.

Pattern Matching

Some commands and flags allow for pattern matching. When enabled, a pattern can include either of these wildcards for character replacement:

  • * to represent a string of characters to match, either in the middle or end.
  • ? to represent a single character.

For example, refer to the following examples for wildcard uses and their results.

Pattern Text Match Result
abc* ab Match
abc* abd Not a match
abc*c abcd Match
ab*??d abxxc Match
ab*??d abxc Match
ab??d abxc Match
ab??d abc Match
ab??d abcxdd Not a match

Global Options

All commands support the following global options. You can also define some of these options using Environment Variables.

--config-dir

option

The path to a JSON formatted configuration file that mc uses for storing data. See Configuration File for more information on how mc uses the configuration file.

Alternatively, set the environment variable MC_CONFIG_DIR.

--debug

option

Enables verbose output to the console.

For example, the following operation adds verbose output to the mc ls command:

mc --debug ls play

Alternatively, set the environment variable MC_DEBUG.

--disable-pager --dp

option

Note

Added: mc

RELEASE.2024-04-29T09-56-05Z

Disable the pager functionality of the MinIO Client in the CLI. When used, output prints to raw STDOUT instead.

--insecure

option

Disables TLS/SSL certificate verification. Allows TLS connectivity to servers with invalid certificates. Exercise caution when using this option against untrusted S3 hosts.

Alternatively, set the environment variable MC_INSECURE.

--json

option

Enables JSON lines formatted output to the console.

For example, the following operation adds JSON Lines output to the mc ls command:

mc --json ls play

Alternatively, set the environment variable MC_JSON.

--no-color

option

Disables the built-in color theme for console output. Useful for dumb terminals.

Alternatively, set the environment variable MC_NO_COLOR.

--quiet

option

Suppresses console output.

Alternatively, set the environment variable MC_QUIET.

--resolve

option

Note

Added: mc

RELEASE.2024-08-13T05-33-17Z

Creates a custom DNS mapping to resolve a HOST to a specified IP address.

Use the following syntax:

--resolve HOST[:PORT]=IP

For example:

mc alias set --resolve myminio.example.com:9000=192.168.188.118 'myminio' 'https://myminio.example.com:9000' 'miniouser' 'miniosecret'

Repeat the flag multiple times to add additional custom DNS mappings.

--version

option

Displays the current version of mc.

--help

mc-cmd

Optional

Displays a summary of command usage on the terminal.

1 - mc alias list

Syntax

The mc alias list command lists all aliases in the local mc configuration.

The command output includes the configured access key and secret key associated to each alias.

The following command lists all aliases configured on the local host machine:

mc alias list

The mc alias list command has the following syntax:

mc [GLOBALFLAGS] alias list [ALIAS]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Optional The name of a specific alias to display.

Global Flags

This command supports any of the global flags.

Examples

List All Configured Aliases

The following mc alias list command lists all configured aliases in the local mc configuration.

mc alias list
mc alias list

List a Specific Alias

The following mc alias list command lists the details of a specific alias in the local mc configuration.

mc alias list myminio
mc alias list ALIAS
  • Replace ALIAS with the name of the alias to return.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

2 - mc anonymous set

Syntax

The mc anonymous set command sets anonymous (i.e. unauthenticated or public) access policies for a bucket.

Buckets with anonymous policies allow clients to access the bucket contents and perform actions consistent with the specified policy without authentication.

To set anonymous bucket policies using an IAM JSON policy, use the mc anonymous set-json command.

The following command sets anonymous access policies for several buckets on the myminio MinIO deployment:

mc anonymous set upload myminio/uploads
mc anonymous set download myminio/downloads
mc anonymous set public myminio/public

Applications can perform the following operations without authentication:

  • PUT objects to myminio/uploads and myminio/public.
  • GET objects from myminio/downloads and myminio/public.

The command has the following syntax:

mc [GLOBALFLAGS] policy set PERMISSION ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

PERMISSION

mc-cmd

Required Name of the policy to assign to the specified ALIAS. Specify one of the following values:

  • none - Disable anonymous access to the ALIAS.
  • download - Enable download-only access to the ALIAS.
  • upload - Enable upload-only access to the ALIAS.
  • public - Enable download and upload access to the ALIAS.
ALIAS

mc-cmd

Required The full path to the bucket or bucket prefix to which the command applies the specified PERMISSION.

Specify the alias of the MinIO or other S3-compatible service and the full path to the bucket or bucket prefix. For example:

mc anonymous set public play/mybucket

Specify a bucket prefix to set the policy on only that prefix. For example, this command sets distinct anonymous bucket policies on the mybucket/downloads and mybucket/uploads prefixes:

mc anonymous set download play/mybucket/downloads
mc anonymous set upload play/mybucket/uploads

Global Flags

This command supports any of the global flags.

Examples

Set Anonymous Policy for Bucket

Use mc anonymous set to set the anonymous policy for a bucket:

mc anonymous set POLICY ALIAS/PATH
  • Replace POLICY with a supported permission.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

3 - mc batch cancel

Note

Added: mc

RELEASE.2023-03-20T17-17-53Z

Syntax

The mc batch cancel stops an ongoing batch job.

You must specify the job ID. To find the job ID, use mc batch list.

The following command outputs the job definition for the job identified as KwSysDpxcBU9FNhGkn2dCf.

mc batch cancel myminio KwSysDpxcBU9FNhGkn2dCf

The command has the following syntax:

mc [GLOBALFLAGS] batch cancel ALIAS JOBID
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias for the MinIO deployment on which the job is currently running.

JOBID

mc-cmd

Required

The unique identifier of the batch job to cancel. To find the ID of a job, use mc batch list.

Global Flags

This command supports any of the global flags.

Example

Cancel an ongoing batch job

The following command cancels the job with ID KwSysDpxcBU9FNhGkn2dCf on the deployment at alias myminio:

mc batch cancel myminio KwSysDpxcBU9FNhGkn2dCf

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

4 - mc encrypt clear

Syntax

The mc encrypt clear command removes the current default encryption settings for a bucket.

The following command removes the default encryption settings for the mydata bucket on the MinIO deployment associated with the myminio alias:

mc encrypt clear myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] encrypt clear ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

The full path to the bucket on which to remove the default SSE mode. Specify the alias of the MinIO deployment as the prefix to the ALIAS path. For example:

mc encrypt clear play/mybucket

Global Flags

This command supports any of the global flags.

Examples

Remove the Automatic Server-Side Encryption Settings for a Bucket

 mc encrypt clear myminio/data
mc encrypt clear ALIAS
  • Replace ALIAS with the alias of the MinIO deployment on which to remove automatic server-side bucket encryption.

Behavior

Modifying Bucket Encryption Settings Does Not Affect Encrypted Objects

Disabling automatic bucket encryption does not decrypt any objects in the bucket.

To permanently decrypt objects in the bucket, you can perform an in-place copy after disabling object decryption. For versioned buckets, the previous object versions remain encrypted.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

5 - mc event add

Syntax

The mc event add command adds event notification triggers to a bucket.

MinIO automatically sends triggered events to the configured notification target.

The following command creates a new event notification trigger for all PUT and DELETE operations for the mydata bucket on the myminio MinIO deployment:

mc event add --event "put,delete" myminio/mydata arn:aws:sqs::primary:target

The specified ARN corresponds to a configured bucket notification target on the myminio deployment.

The command has the following syntax:

mc [GLOBALFLAGS] event add \
                 [--event "string"]  \
                 [--ignore-existing] \
                 [--prefix "string"] \
                 [--suffix "string"] \
                 ALIAS               \
                 ARN
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The MinIO alias and bucket to which the command adds the new event notification. For example:

mc event add play/mybucket
ARN

mc-cmd

Required

The Amazon Resource Name (ARN) of the notification target.

The MinIO server outputs an ARN for each configured notification target at server startup. See Bucket Notifications for more information.

--event

mc-cmd

Optional

The event(s) for which MinIO generates bucket notifications.

Supports the following values:

  • put
  • get
  • delete

Specify multiple value using a comma , delimiter. Do not add any whitespace between values.

If not specified, defaults to put,delete,get.

See Supported Bucket Events for a detailed list of S3 events associated to each of the supported values.

ignore-existing, p

mc-cmd

Optional

Directs MinIO to ignore the specified event triggers if a matching trigger already exists.

--prefix

mc-cmd

Optional

The bucket prefix in which the specified --event can trigger a bucket notification.

For example, given a ALIAS of play/mybucket and a --prefix of photos, only events in play/mybucket/photos trigger bucket notifications.

Omit to trigger the event for all prefixes and objects in the bucket.

--suffix

mc-cmd

Optional

The bucket suffix in which the specified --event can trigger a bucket notification.

For example, given a ALIAS of play/mybucket and a --suffix of .jpg, only events in play/mybucket/*.jpg trigger bucket notifications.

Omit to trigger the event for all objects regardless of suffix.

Global Flags

This command supports any of the global flags.

Examples

Add an Event Notification to a Bucket

The following command adds a new event notification trigger for all S3 PUT, GET, and DELETE operations on a bucket. The command assumes the MinIO deployment has at least one configured bucket notification target:

mc event add myminio/mydata arn:minio:sqs::primary:webhook
mc event add ALIAS ARN
  • Replace ALIAS with the alias of the MinIO deployment and the bucket on which to add the bucket notification event. For example:

    myminio/mydata

  • Replace ARN with the notification target ARN.

Behavior

Supported Bucket Events

The following table lists the supported mc event add values and their corresponding S3 events:

Supported Value

Corresponding S3 Events

put

s3:ObjectCreated:CompleteMultipartUpload
s3:ObjectCreated:Copy
s3:ObjectCreated:DeleteTagging
s3:ObjectCreated:Post
s3:ObjectCreated:Put
s3:ObjectCreated:PutLegalHold
s3:ObjectCreated:PutRetention
s3:ObjectCreated:PutTagging

get

s3:ObjectAccessed:Head
s3:ObjectAccessed:Get
s3:ObjectAccessed:GetRetention
s3:ObjectAccessed:GetLegalHold

delete

s3:ObjectRemoved:Delete
s3:ObjectRemoved:DeleteMarkerCreated

replica

s3:Replication:OperationCompletedReplication
s3:Replication:OperationFailedReplication
s3:Replication:OperationMissedThreshold
s3:Replication:OperationNotTracked
s3:Replication:OperationReplicatedAfterThreshold

ilm

s3:ObjectTransition:Failed
s3:ObjectTransition:Complete
s3:ObjectRestore:Post
s3:ObjectRestore:Completed

scanner

s3:Scanner:ManyVersions
s3:Scanner:BigPrefix

For more complete documentation on the listed S3 events, see S3 Supported Event Types.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

6 - mc idp ldap accesskey disable

Description

mc idp ldap accesskey disable disables the specified access key on the MinIO deployment.

The following example disables the access key mykey on the minio deployment:

mc idp ldap accesskey disable minio mykey

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey disable  \
                                 ALIAS       \
                                 KEY
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Replace KEY with the access key to disable.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey disable minio
KEY

mc-cmd

Required

The configured access key to disable.

Example

Disable the access key mykey from the minio deployment.

mc idp ldap accesskey disable minio/ mykey

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

7 - mc idp ldap add

Description

The mc idp ldap add command creates an AD/LDAP IDP server configuration.

MinIO supports no more than one (1) AD/LDAP provider per deployment.

The following example sets the AD/LDAP configuration settings for the myminio deployment.

mc idp ldap add                                                            \
            myminio                                                        \
            server_addr=myldapserver:636                                   \
            lookup_bind_dn=cn=admin,dc=min,dc=io                           \
            lookup_bind_password=somesecret                                \
            user_dn_search_base_dn=dc=min,dc=io                            \
            user_dn_search_filter="(uid=%s)"                               \
            group_search_base_dn=ou=swengg,dc=min,dc=io                    \
            group_search_filter="(&(objectclass=groupofnames)(member=%d))"

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap add               \
                          ALIAS             \
                          [CFG_PARAM1]      \
                          [CFG_PARAM2]...
  • Replace ALIAS with the alias of a MinIO deployment to create for AD/LDAP integration.

  • Replace the [CFG_PARAM#] with each of the configuration setting key-value pairs in the format of PARAMETER="value".

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment on which to add an AD/LDAP integration.

For example:

mc idp ldap add myminio                               \
                server_addr=myldapserver:636          \
                lookup_bind_dn=cn=admin,dc=min,dc=io  \
                lookup_bind_password=somesecret       \
                user_dn_search_base_dn=dc=min,dc=io   \
                user_dn_search_filter="(uid=%s)"      \
server_addr

mc-cmd

Required

Specify the hostname for the Active Directory / LDAP server. For example:

ldapserver.com:636
Note

srv_record_name automatically identifies the port

If your AD/LDAP server uses DNS SRV Records, do not append the port number to your server_addr value. SRV requests automatically include port numbers when returning the list of available servers.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SERVER_ADDR environment variable.

lookup_bind_dn

mc-cmd

Required

Specify the Distinguished Name (DN) for an AD/LDAP account MinIO uses when querying the AD/LDAP server. Enables Lookup-Bind authentication to the AD/LDAP server.

The DN account should be a read-only access keys with sufficient privileges to support querying performing user and group lookups.

This parameter corresponds with the MINIO_IDENTITY_LDAP_LOOKUP_BIND_DN environment variable.

lookup_bind_password

mc-cmd

Required

Specify the password for the Lookup-Bind user account.

Note

Changed: RELEASE.2023-06-23T20-26-00Z

MinIO redacts this value when returned as part of mc admin config get.

This parameter corresponds with the MINIO_IDENTITY_LDAP_LOOKUP_BIND_PASSWORD environment variable.

user_dn_attributes

mc-cmd

Optional

Note

Added: RELEASE.2024-06-06T09-36-42Z

Comma-separated list of user DN attributes.

Some valid values include, uid,cn,mail,sshPublicKey.

To enable public authentication for LDAP users, pass sshPublicKey as a DN attribute. The user can then use the passed SSH Public Key to log in to SFTP servers.

mc idp ldap update ALIAS user_dn_attributes=sshPublicKey
user_dn_search_base_dn

mc-cmd

Required

Specify the base Distinguished Name (DN) MinIO uses when querying for user credentials matching those provided by an authenticating client.

Separate multiple DNs with a semicolon (;).

For example:

cn=miniousers,dc=myldapserver,dc=net;ou=swengg,dc=min,dc=io

Supports Lookup-Bind mode.

This parameter corresponds with the MINIO_IDENTITY_LDAP_USER_DN_SEARCH_BASE_DN environment variable.

user_dn_search_filter

mc-cmd

Required

Specify the AD/LDAP search filter MinIO uses when querying for user credentials matching those provided by an authenticating client.

Use the %s substitution character to insert the client-specified username into the search string. For example:

(userPrincipalName=%s)

This parameter corresponds with the MINIO_IDENTITY_LDAP_USER_DN_SEARCH_FILTER environment variable.

comment

mc-cmd

Optional

Specify a comment to associate to the AD/LDAP configuration.

This parameter corresponds with the MINIO_IDENTITY_LDAP_COMMENT environment variable.

enabled

mc-cmd

Optional

Set to false to disable the AD/LDAP configuration.

If false, applications cannot generate STS credentials or otherwise authenticate to MinIO using the configured provider.

Defaults to true or “enabled”.

group_search_base_dn

mc-cmd

Optional

Specify a semicolon-separated (;) list of group search base Distinguished Names MinIO uses when performing group lookups.

For example:

cn=miniogroups,dc=myldapserver,dc=net;ou=swengg,dc=min,dc=io

This parameter corresponds with the MINIO_IDENTITY_LDAP_GROUP_SEARCH_BASE_DN environment variable.

group_search_filter

mc-cmd

Optional

Specify an AD/LDAP search filter for performing group lookups for the authenticated user

Use the %s substitution character to insert the client-specified username into the search string. Use the %d substitution character to insert the Distinguished Name of the client-specified username into the search string.

For example:

(&(objectclass=groupOfNames)(memberUid=%s))

When providing an AD/LDAP group search filter, configure a filter that returns the minimum number of relevant groups for the purpose of supporting authentication. Filters that return large group assignments increase the size of associated calls and resources. Functions sensitive to large request or response bodies may exhibit unexpected behaviors as a result.

This parameter corresponds with the MINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER environment variable.

server_insecure

mc-cmd

Optional

Specify on to allow unsecured (non-TLS encrypted) connections to the AD/LDAP server.

MinIO sends AD/LDAP user credentials in plain text to the AD/LDAP server, such that enabling TLS is required to prevent reading credentials over the wire. Using this option presents a security risk where any user with access to network traffic can observe the unencrypted plaintext credentials.

Defaults to off.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SERVER_INSECURE environment variable.

server_starttls

mc-cmd

Optional

Specify on to enable StartTLS connections to an AD/LDAP server.

Defaults to off

For more about StartTLS, refer to section 4.14 of the LDAP RFC 4511 specification.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SERVER_STARTTLS environment variable.

srv_record_name

mc-cmd

Optional

Note

Added: RELEASE.2022-12-12T19-27-27Z

Specify the appropriate value to enable MinIO to select an AD/LDAP server using a DNS SRV record request.

When enabled, MinIO selects an AD/LDAP server by:

  • Constructing the target SRV record name following standard naming conventions.
  • Requesting a list of available AD/LDAP servers.
  • Choosing an appropriate target based on priority and weight.

The configuration examples below presume the AD/LDAP server address is set to example.com and the SRV record protocol is _tcp.

For SRV record names beginning with _ldap, specify ldap. The constructed DNS SRV record name resembles the following:

_ldap._tcp.example.com

For SRV record names with beginning with _ldaps, specify ldaps. The constructed DNS SRV record name resembles the following:

_ldaps._tcp.example.com

If your DNS SRV record name uses alternate service or protocol names, specify on and provide the full record name as your LDAP server address. Example: _ldapserver._specialtcp.example.com

For more about DNS SRV records, see DNS SRV Records for LDAP.

Note

Server address for DNS SRV record configurations

The specified server name must not include a port number. This is different from a standard AD/LDAP configuration, where the port number is required.

See server_addr or MINIO_IDENTITY_LDAP_SERVER_ADDR for more about configuring an AD/LDAP server address.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SRV_RECORD_NAME environment variable.

tls_skip_verify

mc-cmd

Optional

Specify on to trust the AD/LDAP server TLS certificates without verification. This option may be required if the AD/LDAP server TLS certificates are signed by an untrusted Certificate Authority (e.g. self-signed).

Defaults to off

This parameter corresponds with the MINIO_IDENTITY_LDAP_TLS_SKIP_VERIFY environment variable.

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

8 - mc idp ldap policy attach

Description

The mc idp ldap policy attach command attaches one or more polices to an entity.

The following example attaches the policy userpolicy to the user bobfisher on the myminio deployment:

mc idp ldap policy attach myminio                                                  \
                          userpolicy                                               \
                          --user='uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io'

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap policy attach             \
                                 POLICYNAME         \
                                 [POLICY2] ...      \
                                 ALIAS              \
                                 [--user=`USER`]    \
                                 [--group=`GROUP`]
  • Replace ALIAS with the alias of a MinIO deployment to configure for AD/LDAP integration.

  • Replace POLICYNAME with the policy to attach to the entity. You may list multiple policies to attach to the entity.

  • Use must use one of either the --user or --group flag. You may only use the flag once in the command. You cannot use both flags in the same command.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment with the entity to which to attach a policy.

For example:

mc idp ldap policy attach myminio                                                  \
                          userpolicy                                               \
                          --user='uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io'

Example

The following example attaches two policies, policy1 and policy2, to the projectb group on the myminio deployment:

mc idp ldap policy attach myminio                                                 \
                          policy1                                                 \
                          policy2                                                 \
                          --group='cn=projectb,ou=groups,ou=swengg,dc=min,dc=io'

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

9 - mc ilm restore

Syntax

The mc ilm restore command creates a temporary copy of an object archived on a remote tier. The copy automatically expires after 1 day by default.

Use this command to allow applications to access a tiered object through the MinIO deployment (e.g. “hot tier”). The archived object remains on the remote tier, while the temporary copy becomes HEAD for that object.

Note

Added: mc

RELEASE.2023-04-12T02-21-51Z

Use mc stat to display whether a restored object reads from the local temporary copy or the remote tier. Objects currently in the process of restoration from the remote tier show a status of Ongoing : true.

The following command restores a copy of a transitioned object from the remote tier back to the myminio MinIO deployment:

mc ilm restore myminio/mybucket/object.txt

The command has the following syntax:

mc [GLOBALFLAGS] ilm restore         \
                 [--days "int" ]     \
                 [--recursive]       \
                 [--vid "string"]    \
                 [--versions]        \
                 [--enc-c "string"]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The MinIO alias, bucket, and path to the archived object to restore.

mc ilm restore myminio/mybucket/object.txt
--days

mc-cmd

Optional

The number of days after which MinIO expires the restored copy of the archived object.

--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--recursive, r

mc-cmd

Optional

Restores all objects under the specified prefix.

--versions

mc-cmd

Optional

Restores all versions of the object on the remote tier.

--version-id, vid

mc-cmd

Optional

Restores the specified version of the object on the remote tier.

Global Flags

This command supports any of the global flags.

Examples

Restore an Archived Object

The following command restores an object archived to a remote tier:

mc ilm restore myminio/mybucket/object.txt

Restore a Specific Archived Object Version

The following command restore a specific object version archived to a remote tier:

mc ilm restore --vid "VERSIONID" myminio/mybucket/object.txt

Restore All Archived Objects at a Bucket Prefix

The following command restores all objects archived under a specified prefix on the remote tier:

mc ilm restore --recursive myminio/mybucket/data/

Behavior

Restored Objects Expire Automatically

MinIO automatically expires the restored object copy after the specified number of days (Default: 1 day).

Restored Objects Become HEAD

The restored object copy becomes HEAD for that object namespace regardless of it’s versioning history. This can result in applications returning “stale” data while the local copy exists.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

10 - mc ilm rule add

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm rule rm replaces mc ilm add.

Syntax

The mc ilm rule add command adds an object lifecycle management rule to a bucket.

The command supports adding both Transition (Tiering) and Expiration lifecycle management rules.

The following command adds new lifecycle management rules to the mydata bucket on the myminio deployment:

mc ilm rule add --expire-days 90 --noncurrent-expire-days 30  myminio/mydata

mc ilm rule add --expire-delete-marker myminio/mydata

mc ilm rule add --transition-days 30 --transition-tier "COLDTIER" myminio/mydata

mc ilm rule add --noncurrent-transition-days 7 --noncurrent-transition-tier "COLDTIER"

The configured rules have the following effect:

  • Delete objects more than 90 days old
  • Delete objects 30 days after they become non-current
  • Delete DeleteMarker tombstones if that object has no other versions remaining.
  • Transition objects more than 30 days old to the COLDTIER remote tier.
  • Transition objects 7 days after they become non-current to the COLDTIER remote tier.

The command has the following syntax:

mc [GLOBALFLAGS] ilm rule add                               \
                 [--prefix string]                          \
                 [--tags string]                            \
                 [--expire-days "integer"]                  \
                 [--expire-all-object-versions]             \
                 [--expire-delete-marker]                   \
                 [--transition-days "string"]               \
                 [--transition-tier "string"]               \
                 [--noncurrent-expire-days "integer"]       \
                 [--noncurrent-expire-newer "integer"]      \
                 [--noncurrent-transition-days "integer"]   \
                 [--noncurrent-transition-tier "string"]    \
                 [--site-gt "string"]                       \
                 [--size-lt "string"]                       \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias and bucket on the MinIO deployment to which to add the object lifecycle management rule.

For example:

mc ilm rule add myminio/mydata
--prefix

mc-cmd

Optional

Restrict the management rule to a specific object prefix.

For example:

mc ilm rule add --prefix "meetingnotes/" myminio/mydata --expire-days "90"

The command creates a rule that expires objects in the mydata bucket of the myminio ALIAS after 90 days for any object with the meetingnotes/ prefix.

--tags

mc-cmd

Optional

One or more ampersand &-delimited key-value pairs describing the object tags to use for filtering objects to which the lifecycle configuration rule applies.

This option is mutually exclusive with the following option:

--expire-all-object-versions

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-02-24T01-33-20Z

Expire all current and noncurrent versions of an object. Use with the --expire-days option to specify the number of days after which all versions of an object should be deleted by the scanner process.

After the scanner processes this command, no versions of the object remain on the deployment.

Note

Changed: MinIO

RELEASE.2024-05-01T01-11-10Z

This flag only applies to objects that do not have a delete marker as the latest version.

--expire-days

mc-cmd

Optional

The number of days to retain an object after being created. MinIO marks the object for deletion after the specified number of days pass. Specify the number of days as an integer, for example 30 for 30 days.

For versioned buckets, the expiry rule applies only to the current object version. Use either the --noncurrent-expire-days flag or the --expire-all-object-versions flag to apply expiration behavior to noncurrent object versions.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

Mutually exclusive with the following options:

For more complete documentation on object expiration, see Object Expiration and Object Deletion.

--expire-delete-marker

mc-cmd

Optional

Specify this option to direct MinIO to remove delete markers for objects with no remaining object versions. Specifically, the delete marker is the only remaining “version” of the given object.

This option is mutually exclusive with the following option:

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

For more complete documentation on object expiration, see Object Expiration and Object Deletion.

--transition-days

mc-cmd

Optional

The number of calendar days from object creation after which MinIO marks an object as eligible for transition. MinIO transitions the object to the configured remote tier specified to the --transition-tier. Specify the number of days as an integer, e.g. 30 for 30 days. If the remote tier is another MinIO deployment, you can set the value to 0 to mark new objects as immediately eligible for transition to the remote tier.

For versioned buckets, the transition rule applies only to the current object version. Use the --noncurrent-transition-days option to apply transition behavior to noncurrent object versions.

Requires specifying --transition-tier.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

For more complete documentation on object transition, see Object Transition (“Tiering”).

--transition-tier

mc-cmd

Optional

The remote tier to which MinIO transition objects. Specify an existing remote tier created by mc ilm tier add.

Required if specifying --transition-days.

--noncurrent-expire-days

mc-cmd

Optional

The number of days to retain an object version after becoming non-current (i.e. a different version of that object is now the HEAD). MinIO marks noncurrent object versions for deletion after the specified number of days pass.

This option has the same behavior as the S3 NoncurrentVersionExpiration action.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrent-transition-days

mc-cmd

Optional

The number of days an object has been non-current (i.e. replaced by a newer version of that same object) after which MinIO marks the object version as eligible for transition. MinIO transitions the object to the configured remote tier specified to the --transition-tier once the system host datetime passes that calendar date.

This option has no effect on non-versioned buckets. Requires specifying --noncurrent-transition-tier.

This option has the same behavior as the S3 NoncurrentVersionTransition action.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrent-transition-tier

mc-cmd

Optional

The remote tier to which MinIO transitions noncurrent objects versions. Specify a remote tier created by mc ilm tier add.

--noncurrent-expire-newer

mc-cmd

Optional

The maximum number of non-current object versions to retain, ordered from newest to oldest.

Use this flag to retain a certain number of past versions of a file in a first in, first out fashion. After retaining the maximum number of non-current versions, MinIO marks any remaining older non-current object versions as eligible for expiration.

The following table lists a number of object versions and their expiration eligibility based on --noncurrent-expire-newer 3:

v5 (current version)

Current version not affected by ILM rules.

v4

retained

v3

retained

v2

retained

v1

marked for expiry

MinIO retains the current version, v5. MinIO also retains the next 3 non-current versions, starting with the newest. This means MinIO marks v4, v3, and v2 for the three non-current version to retain.

v1 would be a fourth non-current version, which falls outside the limit of non-current versions to retain, so MinIO marks v1 for expiration.

Updating the number for this flag only impacts the unmarked versions of objects. Any versions already marked for expiration do not change if you increase the number to retain.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--size-gt

mc-cmd

Optional

Note

Added: mc

RELEASE.2023-12-02T02-03-28Z

Select objects larger than the specified value. Enter the value as a number and a unit, such as 5GiB for 5 gibibytes.

Valid units include:

Suffix Unit Size
k KB (Kilobyte, 1000 Bytes)
m MB (Megabyte, 1000 Kilobytes)
g GB (Gigabyte, 1000 Megabytes)
t TB (Terrabyte, 1000 Gigabytes)
ki KiB (Kibibyte, 1024 Bites)
mi MiB (Mebibyte, 1024 Kibibytes)
gi GiB (Gibibyte, 1024 Mebibytes)
ti TiB (Tebibyte, 1024 Gibibytes)
--size-lt

mc-cmd

Optional

Note

Added: mc

RELEASE.2023-12-02T02-03-28Z

Select objects smaller than the specified value. Enter the value as a number and a unit, such as 1M for 1 megabyte.

Valid units include:

Suffix Unit Size
k KB (Kilobyte, 1000 Bytes)
m MB (Megabyte, 1000 Kilobytes)
g GB (Gigabyte, 1000 Megabytes)
t TB (Terrabyte, 1000 Gigabytes)
ki KiB (Kibibyte, 1024 Bites)
mi MiB (Mebibyte, 1024 Kibibytes)
gi GiB (Gibibyte, 1024 Mebibytes)
ti TiB (Tebibyte, 1024 Gibibytes)

Global Flags

This command supports any of the global flags.

Examples

Expire All Bucket Contents After Number of Days

Use mc ilm rule add with the --expire-all-object-versions and --expire-days flags to mark all current and non-current bucket contents for expiration after a number of days pass from the object’s creation:

mc ilm rule add ALIAS/PATH --expire-all-object-versions --expire-days "DAYS"
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket on the S3-compatible host.
  • Replace DAYS with the number of days after which to expire each object. For example, specify 30 to expire objects 30 days after creation.

Transition Non-Current Object Versions at a Prefix to a Different Tier

Use the mc ilm rule add with --prefix and --transition-tier to transition older non-current versions of an object to a different storage tier.

mc ilm rule add --prefix "doc/" --transition-days "90" --transition-tier "MINIOTIER-1"  \
       --noncurrent-transition-days "45" --noncurrent-transition-tier "MINIOTIER-2"    \
       myminio/mybucket

This command looks at the contents with the doc/ prefix in the mybucket bucket on the myminio deployment.

  • Current objects in the prefix older than 90 days move to the MINIOTIER-1 storage tier.
  • Non-current objects in the prefix older than 45 days move to the MINIOTIER-2 storage tier.
  • Both MINIOTIER-1 and MINIOTIER-2 have already been created with mc admin tier add.

Expire All Objects at a Prefix, Retain Current Object Versions Longer Than Non-Current Object Versions

Use the mc ilm rule add command with --prefix, --expire-days, and --noncurrent-expire-days to expire current and non-current versions of an object at different times.

mc ilm rule add --prefix "doc/" --expire-days "300" --noncurrent-expire-days "100" myminio/mybucket

This command looks at the contents with the doc/ prefix in the mybucket bucket on the myminio deployment.

  • Current objects expire after 300 days.
  • Non-current objects expire after 100 days.

Transition noncurrent versions in the prefix /doc with a size greater the 1MiB

Use the mc ilm rule add command with --prefix, --size-gt, and --noncurrent-expire-days to expire current and non-current versions of an object at different times.

mc ilm rule add --prefix "doc/" --size-gt 1MiB --transition-days "90" --transition-tier "MINIOTIER-1" \
      --noncurrent-transition-days "45" --noncurrent-transition-tier "MINIOTIER-1" \
      myminio/mybucket/

This command looks at the contents with the doc/ prefix in the mybucket bucket on the myminio deployment.

The command selects the following objects:

  • Current objects older than 90 days larger than 1MiB.
  • Non-current objects older than 45 days larger than 1MiB.

Selected objects transition to MINIOTIER-1.

Remove Delete Markers

The following command removes delete markers for objects where the delete marker is the only version of the object that remains.

mc ilm rule add ALIAS/PATH --expire-delete-marker
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket on the S3-compatible host.
Note

Note

To delete all versions of an object with a delete marker as its latest version, including the delete marker, consider using batch expiration.

Required Permissions

For permissions required to add a rule, refer to the required permissions on the parent command.

Behavior

Lifecycle Management Object Scanner

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

Expiry vs Transition

MinIO supports specifying both expiry and transition rules in the same bucket or bucket prefix. MinIO can execute an expiration rule on an object regardless of its transition status. Use mc ilm rule ls to review the currently configured object lifecycle management rules for any potential interactions between expiry and transition rules.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

11 - mc ilm tier add

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm tier add replaces mc admin tier add.

Description

The mc ilm tier add command creates a new remote storage tier to a supported storage services.

See Object Transition for a complete list.

Supported S3 Services

mc ilm tier add supports only the following S3-compatible services as a remote target for object tiering:

  • MinIO
  • Amazon S3
  • Google Cloud Storage
  • Azure Blob Storage

Permissions

MinIO requires the following administrative permissions on the cluster in which you create remote tiers for object transition lifecycle management rules:

For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "admin:SetTier",
               "admin:ListTier"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteTierManagement"
      },
      {
            "Action": [
               "s3:PutLifecycleConfiguration",
               "s3:GetLifecycleConfiguration"
            ],
            "Resource": [
                        "arn:aws:s3:::*"
            ],
            "Effect": "Allow",
            "Sid": "EnableLifecycleManagementRules"
      }
   ]
}

Syntax

The following example creates a new remote tier called WARM-MINIO-TIER on the myminio deployment. The command creates a tier for a remote MinIO deployment located at the hostname https://warm-minio.com.

 mc ilm tier add minio myminio WARM-MINIO-TIER                     \
                               --endpoint https://warm-minio.com   \
                               --access-key ACCESSKEY              \
                               --secret-key SECRETKEY              \
                               --bucket mybucket                   \
                               --prefix myprefix/

Lifecycle management rules on the myminio deployment can use the new tier to transition objects into the remote location’s myprefix/ prefix in the mybucket bucket.

The command has the following syntax:

mc ilm tier add TIER_TYPE                    \
                TARGET                       \
                TIER_NAME                    \
                --bucket value               \
                [--endpoint string]          \
                [--region string]            \
                [--access-key value^]        \
                [--secret-key value^]        \
                [--use-aws-role^]            \
                [--aws-role-arn^]            \
                [--aws-web-identity-file^]   \
                [--azure-sp-tenant-id^]      \
                [--azure-sp-client-id^]      \
                [--azure-sp-client-secret^]  \
                [--account-name value^]      \
                [--account-key value^]       \
                [--credentials-file value^]  \
                [--prefix value]             \
                [--storage-class value]

^Note: Each supported storage vendor authenticates with different methods. The flags to use for authentication vary by storage vendor. See details under TIER_TYPE below.

  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

The command accepts the following arguments:

TIER_TYPE

mc-cmd

Required

The Cloud Service Provider storage backend (“Tier”) to which MinIO transitions objects. Specify one of the following supported values:

minio

Use a remote MinIO deployment as the storage backend for the new Tier.

Requires also specifying the following parameters:

s3

Use AWS S3 as the storage backend for the new Tier.

Requires also specifying the following parameters:

azure

Use Azure Blob Storage as the storage backend for the new Tier.

Requires also specifying the following parameters:

gcs

Use GCP Cloud Storage as the storage backend for the new Tier.

Requires also specifying the following parameter:

TARGET

mc-cmd

Required

The alias of a configured MinIO deployment on which the command creates the new remote tier. You can then create new rules with mc ilm rule add specifying the new remote tier.

TIER_NAME

mc-cmd

Required

The name to associate with the new remote tier. The name must be unique across all configured tiers on the MinIO cluster.

You must specify the tier in all-caps, e.g. WARM_TIER.

--endpoint

mc-cmd

Optional

The URL endpoint for the S3 or MinIO storage. The URL endpoint must resolve to the provider specified to TIER_TYPE.

Required for s3 or minio tier types, optional for azure. This option has no effect for any other value of TIER_TYPE.

--access-key

mc-cmd

Optional

The access key for a user on the remote S3 or minio tier types. The user must have permission to perform read/write/list/delete operations on the remote bucket or bucket prefix.

Required if TIER_TYPE is s3 or minio. This option has no effect for any other value of TIER_TYPE.

--secret-key

mc-cmd

Optional

The secret key for a user on the remote s3 or minio tier types.

Required if TIER_TYPE is s3 or minio. This option has no effect for any other value of TIER_TYPE.

--account-name

mc-cmd

Optional

The Storage Account to use as the remote storage resource.

Required if TIER_TYPE is azure. This option has no effect for any other value of TIER_TYPE.

MinIO does not support changing the storage account name associated to an Azure remote tier. Azure storage backends are tied to the storage account, such that changing this value would change the storage backend and prevent access to any objects transitioned to the original account/backend.

--account-key

mc-cmd

Optional

The corresponding shared account key for the --account-name associated to the remote Azure tier.

The account key must have an assigned Azure policy with the required permissions.

Required if TIER_TYPE is azure. This option has no effect for any other value of TIER_TYPE.

--credentials-file

mc-cmd

Optional

The credential file for a user on the remote Google Cloud Storage tier. The user must have permission to perform read/write/list/delete operations on the remote bucket or bucket prefix.

Required if TIER_TYPE is gcs. This option has no effect for any other value of TIER_TYPE.

--bucket

mc-cmd

Required

The bucket on the remote tier to which MinIO transitions objects.

For azure remote tiers, this value corresponds to the Container name

--prefix

mc-cmd

Optional

The prefix path for the specified --bucket to which MinIO transitions objects.

Omit this field to transition objects into the bucket root.

--storage-class

mc-cmd

Optional

The storage class (“access tier” for Microsoft Azure) MinIO applies to objects transitioned to the remote bucket.

The storage class to apply to objects transitioned by MinIO to the remote bucket. MinIO tiering behavior depends on the remote storage returning objects immediately (milliseconds to seconds) upon request. MinIO therefore cannot support remote storage which requires rehydration, wait periods, or manual intervention.

Select the tab corresponding to the TIER_TYPE for a list of supported values for each tier:

  • STANDARD Recommended
  • REDUCED

For more information, see Erasure Coding storage class.

  • STANDARD
  • STANDARD-IA
  • ONEZONE-IA

For more information, see Using Amazon S3 storage classes.

  • STANDARD
  • NEARLINE
  • COLDLINE

For more information, see GCS storage class.

  • Hot
  • Cool

For more information, see Hot, cool, and archive access tiers for blob data.

If omitted, objects use the default storage class defined for the remote bucket.

--region

mc-cmd

Optional

The S3 backend region for the specified TIER_TYPE, such as us-west-1.

This option only applies if TIER_TYPE is s3 or minio. This option has no effect for any other value of TIER_TYPE.

--use-aws-role

mc-cmd

Optional

Use the access permission for the locally configured AWS Role.

This option only applies if TIER_TYPE is s3 or minio. This option has no effect for any other value of TIER_TYPE.

--aws-role-arn

mc-cmd

Optional

The AWS S3 role name to use when transitioning objects.

This option only applies if TIER_TYPE is s3 and the source is a MinIO pod on Amazon EKS.

--aws-web-identity-file

mc-cmd

Optional

Specify the web identity token file to use when transitioning objects.

This option only applies if TIER_TYPE is s3 and the source is a MinIO pod on Amazon EKS.

--azure-sp-tenant-id

mc-cmd

Optional

Tenant ID for the service principal account to use to log in to Azure storage.

This option only applies if TIER_TYPE is azure and you log in using a service principal identity. This option has no effect for any other value of TIER_TYPE.

--azure-sp-client-id

mc-cmd

Optional

Client ID for the service principal account to use to log in to Azure storage.

This option only applies if TIER_TYPE is azure and you log in using a service principal identity. This option has no effect for any other value of TIER_TYPE.

--azure-sp-client-secret

mc-cmd

Optional

The client secret for the service principal account to use to log in to Azure storage.

This option only applies if TIER_TYPE is azure and you log in using a service principal identity. This option has no effect for any other value of TIER_TYPE.

Global Flags

This command supports any of the global flags.

Examples

Configure a Tier to Transition Objects to a MinIO Deployment

The following example creates a new tier on a local deployment that a configured rule can use to transition objects to a separate, remote MinIO deployment.

mc ilm tier add minio myminio WARM-MINIO-TIER --endpoint https://warm-minio.com \
     --access-key ACCESSKEY --secret-key SECRETKEY --bucket mybucket --prefix myprefix/

This command creates a new tier called WARM-MINIO-TIER for a minio type of remote storage on the myminio deployment.

  • The remote MinIO storage is located at https://warm-minio.com.
  • The command includes credentials for a user with read, write, list, and delete privileges to the bucket and prefix.
  • The tier transitions objects to the mybucket bucket and the myprefix prefix on the remote MinIO storage.

Configure a Tier to Transition Objects to an Azure Blob Storage Location

The following example creates a new tier on a local deployment that a configured rule can use to transition objects to Azure Blob Storage.

mc ilm tier add azure myminio AZTIER --account-name ACCOUNT-NAME --account-key ACCOUNT-KEY \
     --bucket myazurebucket --prefix myazureprefix/

This command creates a new tier called AZTIER for an azure type of remote storage on the myminio deployment.

  • The remote Azure storage is accessed by the provided account name and key.
  • The tier transitions objects to the myazurebucket bucket and the myazureprefix prefix on the Azure storage.

Configure a Tier to Transition Objects to Google Cloud Storage

The following example creates a new tier on a local deployment that a configured rule can use to transition objects to Google Cloud Storage.

 mc ilm tier add gcs myminio GCSTIER --credentials-file /path/to/credentials.json \
     --bucket mygcsbucket  --prefix mygcsprefix/

This command creates a new tier called GCSTIER for a gcs type of remote storage on the myminio deployment.

  • The remote GCS storage is accessed by the provided credentials file.
  • The tier transitions objects to the mygcsbucket bucket and the mygcsprefix prefix on the GCS storage.

Configure a Tier to Transition Objects to Amazon Simple Storage Service (S3)

The following example creates a new tier on a local deployment that a configured rule can use to transition objects to a STANDARD storage on S3.

 mc ilm tier add s3 myminio S3TIER --endpoint https://s3.amazonaws.com \
     --access-key ACCESSKEY --secret-key SECRETKEY --bucket mys3bucket --prefix mys3prefix/ \
     --storage-class "STANDARD" --region us-west-2

This command creates a new tier called S3TIER for a s3 type of remote storage on the myminio deployment.

  • The S3 storage is located at the provided endpoint.
  • The remotes S3 storage is accessed by the provided access key and secret key.
  • The tier transitions objects to the mys3bucket bucket and the mys3prefix prefix on the GCS storage.
  • The tier utilizes S3 STANDARD storage class located in the us-west-2 S3 region.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Permissions

For permissions required to add a tier, refer to the required permissions on the parent command.

12 - mc legalhold clear

Syntax

The mc legalhold clear command removes the current legal hold setting for an object or objects.

Removing the legal hold on object(s) does not remove any other GOVERNANCE Mode and COMPLIANCE Mode retention settings in place for the object(s)

The following command removes the legal hold on all objects in the mydata bucket on the myminio MinIO deployment:

mc legalhold clear --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] legalhold clear \
                 [--recursive]   \
                 [--rewind]      \
                 [--version-id]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The MinIO alias and path to the object or objects on which to remove the legal hold. For example:

mc legalhold clear play/mybucket/myobjects/objects.txt
--recursive, r

mc-cmd

Optional

Removes the legal hold on all objects in the ALIAS bucket or bucket prefix.

--rewind

mc-cmd

Optional

Directs mc legalhold clear to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, vid

mc-cmd

Optional

Directs mc legalhold clear to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Global Flags

This command supports any of the global flags.

Examples

Use mc legalhold clear to retrieve the legal hold status of an object. Include --recursive to return the legal hold status of the contents of a bucket:

mc legalhold clear [--recursive] ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the --recursive option.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

13 - mc license info

Description

The mc license info command displays information about the MinIO deployment’s license status. Specifically, whether the deployment uses the AGPLv3 Open Source license of the MinIO Commercial License.

You must register your deployment with MinIO MinIO SUBNET to activate your commercial license.

For example, the command returns the following information for an unregistered deployment:

You are using GNU AFFERO GENERAL PUBLIC LICENSE Version 3 (https://www.gnu.org/licenses/agpl-3.0.txt)

If you are building proprietary applications, you may want to choose the commercial license
included as part of the Standard and Enterprise subscription plans. (https://min.io/signup?ref=mc)

Applications must otherwise comply with all the GNU AGPLv3 License & Trademark obligations.

Use mc license register to associate your deployment with your SUBNET account. If you are not already signed up for SUBNET, see the Registration page.

Examples

Display the Current License for a Deployment with Alias minio1

mc license info minio1

If a deployment uses an expired MinIO Commercial License, the command outputs an error message.

Syntax

The command has the following syntax:

mc [GLOBALFLAGS] license info       \
                         ALIAS      \
                         [--airgap]

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

--airgap

mc-cmd

Optional

Use in environments where the client machine running the minio client does not have network access to SUBNET (for example, airgapped, firewalled, or similar configuration) to display instructions for how to register the deployment with SUBNET.

If the deployment is airgapped, but the local device has network access, you do not need to use the --airgap flag.

Global Flags

This command supports any of the global flags.

14 - mc replicate add

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc replicate add replaces the mc admin bucket remote add command.

MinIO automatically creates remote targets based on a given file path or resource location (such as an IP or DNS address). Users defining a remote target no longer need to determine an ARN for the remote bucket.

Syntax

The mc replicate add command creates a new server-side replication rule for a bucket on a MinIO deployment.

The remote bucket must be on a MinIO deployment running the same version of MinIO as the local deployment.

Note

Note

Where mc mirror only synchronizes the current version of an object, mc replicate synchronizes all versions, version information, and metadata for the objects.

The MinIO deployment automatically begins synchronizing new objects to the remote MinIO deployment after creating the rule. You can optionally configure synchronization of existing objects, delete operations, and fully-deleted objects.

The following command adds a new replication rule for the mydata bucket on the myminio MinIO deployment:

mc replicate add                                                     \
   --remote-bucket https://user:[email protected]:9001/bucket  \
   --replicate "delete,delete-marker,existing-objects"               \
   myminio/mydata

The replication rule synchronizes versioned delete operations, delete markers, and existing objects to the remote MinIO deployment.

Note

Changed: mc

RELEASE.2024-03-03T00-13-08Z

You can use a configured ALIAS to the --remote-bucket flag.

The command has the following syntax:

mc [GLOBALFLAGS] replicate add                     \
                 --remote-bucket string          \
                 [--bandwidth "string"]            \
                 [--disable]                       \
                 [--disable-proxy]                 \
                 [--healthcheck-seconds integer]   \
                 [--id "string"]                   \
                 [--limit-upload "string"]         \
                 [--limit-download "string"]       \
                 [--path "string"]                 \
                 [--region "string"]               \
                 [--replicate "string"]            \
                 [--storage-class "string"]        \
                 [--sync]                          \
                 [--tags "string"]                 \
                 [--priority int]                  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment and full path to the bucket or bucket prefix on which to create the replication rule. For example:

mc replicate add --remote-bucket https://user:[email protected]:9001/bucket play/mybucket
--remote-bucket

mc-cmd

Required

Note

Changed: mc

RELEASE.2024-03-03T00-13-08Z

The --remote-bucket supports specifying an existing alias.

Specify the credentials, destination deployment, and bucket of the remote location. Value may be an IP address, URL, or alias/bucket.

For example, a URL based target might look like the following:

https://user:[email protected]:9001/bucket

An alias based target might look like the following:

--remote-bucket minio-target/my-bucket
--bandwidth

mc-cmd

Optional

Limit bandwidth rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit bandwidth rates to no more than 1 GiB/s, use the following:

--limit-upload 1Gi

If not specified, MinIO does not limit the bandwidth rate.

--disable

mc-cmd

Optional

Creates the replication rule in the “disabled” state. MinIO does not begin replicating objects using the rule until it is enabled using mc replicate update.

Objects created while replication is disabled are not immediately eligible for replication after enabling the rule. You must explicitly enable replication of existing objects by including "existing-objects" to the list of replication features specified to mc replicate update --replicate. See Replication of Existing Objects for more information.

--disable-proxy

mc-cmd

Optional

When defining active-active replication between buckets, do not proxy.

By default, MinIO proxies.

--healthcheck-seconds

mc-cmd

Optional

The length of time in seconds between checks on the health of the remote bucket.

If not specified, MinIO uses an interval of 60 seconds.

--id

mc-cmd

Optional

Specify a unique ID for the replication rule. MinIO automatically generates an ID if one is not specified.

--limit-download

mc-cmd

Optional

Limit download rates to no more than a specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit download rates to no more than 1 GiB/s, use the following:

--limit-download 1G

If not specified, MinIO uses an unlimited download rate.

--limit-upload

mc-cmd

Optional

Limit upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following:

--limit-upload 1G

If not specified, MinIO uses an unlimited upload rate.

--path

mc-cmd

Optional

Enable path-style lookup support for the remote bucket.

Valid values include:

  • on - use a path lookup to find the remote bucket
  • off - use a resource locator style (such as a domain or IP address) lookup to find the remote bucket
  • auto - ask MinIO to identify the correct type of lookup to use to find the remote bucket

When not defined, MinIO uses the auto value.

--priority

mc-cmd

Optional

Specify the integer priority of the replication rule. The value must be unique among all other rules on the source bucket. Higher values imply a higher priority than all other rules.

The default value is 0.

--region

mc-cmd

Optional

The region of the destination bucket to replicate contents to.

--replicate

mc-cmd

Optional

Specify a comma-separated list of the following values to enable extended replication features.

  • delete - Directs MinIO to replicate DELETE operations to the destination bucket.

  • delete-marker - Directs MinIO to replicate delete markers to the destination bucket.

  • existing-objects - Directs MinIO to replicate objects created before replication was enabled or while replication was suspended.

  • metadata-sync - Directs MinIO to replicate metadata for each object. For active-active replication situations only.

    Omitting this value directs MinIO to stop replicating metadata-only changes back to the source.

If not specified, MinIO syncs all options.

--storage-class

mc-cmd

Optional

Specify the MinIO storage class to apply to replicated objects.

--sync

mc-cmd

Optional

Enable synchronous replication for this remote target.

By default, MinIO uses asynchronous replication.

--tags

mc-cmd

Optional

Specify one or more ampersand & separated key-value pair tags which MinIO uses for filtering objects to replicate. For example:

mc replicate add --tags "TAG1=VALUE&TAG2=VALUE&TAG3=VALUE" ALIAS

MinIO applies the replication rule to any object whose tag set contains the specified replication tags.

Global Flags

This command supports any of the global flags.

Examples

Configure Bucket Replication

The following mc replicate add command creates a replication configuration that synchronizes all new objects, existing objects, delete operations, and delete markers to the remote target:

mc replicate add myminio/mybucket \
   --remote-bucket https://user:[email protected]/remotebucket \
   --replicate "delete,delete-marker,existing-objects"
  • Replace myminio/mybucket with the ALIAS and full bucket path for which to create the replication configuration.
  • Replace the --remote-bucket value with the URL or path of the remote target. If using a file path format location, use the --path on option.
  • The --replicate flag directs MinIO to replicate all delete operations, delete markers, and existing objects to the remote. See Replication of Delete Operations and Replication of Existing Objects for more information on replication behavior.

Configure Bucket Replication for Historical Data Record

The following mc replicate add command creates a new bucket replication configuration that synchronizes all new and existing objects to the remote target:

mc replicate add myminio/mybucket \
   --remote-bucket https://user:[email protected]/remotebucket \
   --replicate "existing-objects"
  • Replace myminio/mybucket with the ALIAS and full bucket path for which to create the replication configuration.
  • Replace the --remote-bucket value with the location of the remote target. If using a file path format location, use the --path on option.
  • The --replicate flag directs MinIO to replicate all existing objects to the remote. See Replication of Existing Objects for more information on replication behavior.

The resulting remote copy represents a historical record of objects on the remote, where delete operations on the source have no effect on the remote copy.

Behavior

Server-Side Replication Requires MinIO Source and Destination

MinIO server-side replication only works between MinIO deployments. Both the source and destination deployments must run MinIO.

To configure replication between arbitrary S3-compatible services, use mc mirror.

Enable Versioning on Source and Destination Buckets

MinIO relies on the immutability protections provided by versioning to synchronize objects between the source and replication target.

Use the mc version enable command to enable versioning on both the source and destination bucket before starting this procedure:

mc version enable ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the bucket on which to enable versioning.

Required Permissions

MinIO strongly recommends creating users specifically for supporting bucket replication operations. See mc admin user and mc admin policy for more complete documentation on adding users and policies to a MinIO deployment.

The following policy provides permissions for configuring and enabling replication on a deployment.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "admin:SetBucketTarget",
                "admin:GetBucketTarget",
                "admin:ListBatchJobs",
                "admin:DescribeBatchJob",
                "admin:StartBatchJob",
                "admin:CancelBatchJob"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteBucketConfiguration"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetReplicationConfiguration",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:GetBucketLocation",
                "s3:GetBucketVersioning",
                "s3:GetObjectRetention",
                "s3:GetObjectLegalHold",
                "s3:PutReplicationConfiguration"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ],
            "Sid": "EnableReplicationRuleConfiguration"
        }
    ]
}
  • The "EnableRemoteBucketConfiguration" statement grants permission for creating a remote target for supporting replication.
  • The "EnableReplicationRuleConfiguration" statement grants permission for creating replication rules on a bucket. The "arn:aws:s3:::* resource applies the replication permissions to any bucket on the source deployment. You can restrict the user policy to specific buckets as-needed.

Use the mc admin policy create to add this policy to each deployment acting as a replication source. Use mc admin user add to create a user on the deployment and mc admin policy attach to associate the policy to that new user.

The following policy provides permissions for enabling synchronization of replicated data into the deployment.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetReplicationConfiguration",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:GetBucketLocation",
                "s3:GetBucketVersioning",
                "s3:GetBucketObjectLockConfiguration",
                "s3:GetEncryptionConfiguration"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ],
            "Sid": "EnableReplicationOnBucket"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetReplicationConfiguration",
                "s3:ReplicateTags",
                "s3:AbortMultipartUpload",
                "s3:GetObject",
                "s3:GetObjectVersion",
                "s3:GetObjectVersionTagging",
                "s3:PutObject",
                "s3:PutObjectRetention",
                "s3:PutBucketObjectLockConfiguration",
                "s3:PutObjectLegalHold",
                "s3:DeleteObject",
                "s3:ReplicateObject",
                "s3:ReplicateDelete"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ],
            "Sid": "EnableReplicatingDataIntoBucket"
        }
    ]
}
  • The "EnableReplicationOnBucket" statement grants permission for a remote target to retrieve bucket-level configuration for supporting replication operations on all buckets in the MinIO deployment. To restrict the policy to specific buckets, specify those buckets as an element in the Resource array similar to "arn:aws:s3:::bucketName".
  • The "EnableReplicatingDataIntoBucket" statement grants permission for a remote target to synchronize data into any bucket in the MinIO deployment. To restrict the policy to specific buckets, specify those buckets as an element in the Resource array similar to "arn:aws:s3:::bucketName/*".

Use the mc admin policy create to add this policy to each deployment acting as a replication target. Use mc admin user add to create a user on the deployment and mc admin policy attach to associate the policy to that new user.

Replication of Existing Objects

Starting with mc RELEASE.2021-06-13T17-48-22Z and minio RELEASE.2021-06-07T21-40-51Z, MinIO supports automatically replicating existing objects in a bucket. MinIO existing object replication implements functionality similar to AWS Replicating existing objects between S3 buckets without the overhead of contacting technical support.

  • To enable replication of existing objects when creating a new replication rule, include "existing-objects" to the list of replication features specified to mc replicate add --replicate.
  • To enable replication of existing objects for an existing replication rule, add "existing-objects" to the list of existing replication features using mc replicate add --replicate. You must specify all desired replication features when editing the replication rule.

See Replication of Existing Objects for more complete documentation on this behavior.

Synchronization of Metadata Changes

MinIO supports two-way active-active replication configurations, where MinIO synchronizes new and modified objects between a bucket on two MinIO deployments. Starting with mc RELEASE.2021-05-18T03-39-44Z, MinIO by default synchronizes metadata-only changes to a replicated object back to the “source” deployment. Prior to the this update, MinIO did not support synchronizing metadata-only changes to a replicated object.

With metadata synchronization enabled, MinIO resets the object replication status to indicate replication eligibility. Specifically, when an application performs a metadata-only update to an object with the REPLICA status, MinIO marks the object as PENDING and eligible for replication.

To disable metadata synchronization, use the mc replicate update --replicate command and omit replica-metadata-sync from the replication feature list.

Replication of Delete Operations

MinIO supports replicating delete operations onto the target bucket. Specifically, MinIO can replicate both Delete Markers and the deletion of specific versioned objects:

  • For delete operations on an object, MinIO replication also creates the delete marker on the target bucket.
  • For delete operations on versions of an object, MinIO replication also deletes those versions on the target bucket.

MinIO does not replicate objects deleted due to lifecycle management expiration rules. MinIO only replicates explicit client-driven delete operations.

MinIO requires explicitly enabling replication of delete operations using the mc replicate add --replicate flag. This procedure includes the required flags for enabling replication of delete operations and delete markers. See Replication of Delete Operations for more complete documentation on this behavior.

Replication of Encrypted Objects

MinIO supports replicating objects encrypted with automatic Server-Side Encryption (SSE-S3). Both the source and destination buckets must have automatic SSE-S3 enabled for MinIO to replicate an encrypted object.

As part of the replication process, MinIO decrypts the object on the source bucket and transmits the unencrypted object. The destination MinIO deployment then re-encrypts the object using the destination bucket SSE-S3 configuration. MinIO strongly recommends enabling TLS on both source and destination deployments to ensure the safety of objects during transmission.

MinIO does not support replicating client-side encrypted objects (SSE-C).

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

15 - mc retention set

Syntax

The mc retention set command configures the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also set the default object lock settings for a bucket, where all objects without explicit object lock settings inherit the bucket default.

To lock an object under legal hold, use mc legalhold set.

mc retention set requires that the specified bucket has object locking enabled. You can only enable object locking at bucket creation. See mc mb --with-lock for documentation on creating buckets with object locking enabled.

The following command sets a default 30 day GOVERNANCE object lock on the mydata bucket on the myminio MinIO deployment:

mc retention set --default GOVERNANCE "30d" myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] retention set                         \
                 [--bypass]                            \
                 [--default]                           \
                 [--recursive]                         \
                 [--rewind "string"]                   \
                 [--versions]                          \
                 [--version-id "string"]*              \
                 MODE                                  \
                 "VALIDITY"                            \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc retention set --version-id is mutually exclusive with multiple other parameters. See the reference documentation for more information.

Parameters

MODE

mc-cmd

Required

Sets the locking mode for the ALIAS. Specify one of the following supported values:

  • governance
  • compliance

See the AWS S3 documentation on Object Lock Overview for more information on the supported modes.

Requires specifying VALIDITY.

VALIDITY

mc-cmd

Required

The duration which objects remain in the specified MODE after creation.

  • For days, specify a string formatted as Nd. For example,

    30d for 30 days after object creation.

  • For years, specify a string formatted as Ny. For example,

    1y for 1 year after object creation.

ALIAS

mc-cmd

Required

The full path to the object or objects for which to set object lock configuration. Specify the alias for the MinIO or S3-compatible service and the full path to bucket. For example:

mc retention set play/mybucket/object.txt MODE VALIDITY
  • If the ALIAS specifies a bucket or bucket prefix, include --recursive to apply the object lock settings to the bucket contents.
  • mc retention set by default applies to only the latest object version. Use --version-id or --versions to apply the object lock settings to a specific version or to all versions of the object respectively.
--bypass

mc-cmd

Optional

Allows a user with the s3:BypassGovernanceRetention permission to modify the object. Requires the governance retention MODE

--default

mc-cmd

Optional

Sets the default object lock settings for the bucket specified to ALIAS using the MODE and VALIDITY. Any objects created in the bucket inherit the default object lock settings unless explicitly overriden using mc retention set.

If specifying --default, mc retention set ignores all other flags.

--recursive, --r

mc-cmd

Optional

Recursively applies the object lock settings to all objects in the specified ALIAS path.

Mutually exclusive with --version-id.

--rewind

mc-cmd

Optional

Directs mc retention set to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, --vid

mc-cmd

Optional

Directs mc retention set to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with any of the following flags:

--versions

mc-cmd

Optional

Directs mc retention set to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to apply the retention settings to all object versions that existed at a specific point-in-time.

Global Flags

This command supports any of the global flags.

Examples

Set Default Bucket Retention Settings

Use mc retention set with the --recursive and --default to set the default bucket retention settings.

mc retention set  --recursive --default MODE DURATION ALIAS/PATH
  • Replace MODE with the retention mode to enable. MinIO supports the AWS S3 retention modes governance and compliance.
  • Replace DURATION with the duration which the object lock should remain in effect. For example, to set a retention period of 30 days, specify 30d.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the bucket.

The bucket must have object locking enabled to use this command. You can only enable object locking when creating a bucket. See mc mb --with-lock for more information on creating buckets with object locking enabled.

Set Object Lock Configuration for Versioned Object

Use mc retention set with --version-id to apply the retention settings to a specific object version:

mc retention set --version-id VERSION MODE DURATION ALIAS/PATH
  • Replace VERSION with the version of the object.
  • Replace MODE with the retention mode to enable. MinIO supports the AWS S3 retention modes governance and compliance.
  • Replace DURATION with the duration which the object lock should remain in effect. For example, to set a retention period of 30 days, specify 30d.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the object.

Use mc retention set with --versions to apply the retention settings to a specific object version:

mc retention set --versions  MODE DURATION ALIAS/PATH
  • Replace MODE with the retention mode to enable. MinIO supports the AWS S3 retention modes governance and compliance.
  • Replace DURATION with the duration which the object lock should remain in effect. For example, to set a retention period of 30 days, specify 30d.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the object.

The bucket must have object locking enabled to use this command. You can only enable object locking when creating a bucket. See mc mb --with-lock for more information on creating buckets with object locking enabled.

Behavior

Retention of Object Versions

For buckets with versioning enabled, mc retention set by default operates on the latest version of the target object or object(s). mc retention set includes specific options that when explicitly specified direct the command to operate on either a specific object version or all versions of an object:

To direct mc retention set to operate on a specific version of an object, include the --version-id argument:

To direct mc retention set to operate on all versions of an object, include the --versions argument:

Locking an object prevents any modification or deletion of that object, similar to the COMPLIANCE object locking mode. Objects can have simultaneous retention-based locks and legal hold locks.

The legal hold lock overrides any retention locking, such that an object under legal hold remains locked even if the retention period expires. Setting, modifying, or clearing retention settings for an object under legal hold has no effect until the legal hold either expires or is explicitly disabled.

For more information on object legal holds, see mc legalhold.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

16 - mc share download

Syntax

The mc share download command generates a temporary presigned URL with integrated access credentials for downloading objects from a MinIO bucket. The temporary URL expires after a configurable time limit.

  • Applications can perform a GET to retrieve the object from the URL.
  • Users can open the URL in a browser to download the object.

For more information on shareable object URLs, see the Amazon S3 documentation on Pre-Signed URLs.

The following command generates a new presigned download URL for the mydata bucket on the myminio MinIO deployment:

mc share download --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] share download           \
                 [--expire "string"]      \
                 [--recursive]            \
                 [--version-id "string"]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of a MinIO deplyment and the full path to the object for which to generate a download URL. For example:

mc share download play/mybucket/object.txt

You can specify multiple objects on the same or different MinIO deployments. For example:

mc share download play/mybucket/object.txt play/mybucket/otherobject.txt

If specifying the path to a bucket or bucket prefix, you must also specify the --recursive argument. For example:

mc share download --recursive play/mybucket/

mc share download --recursive play/mybucket/myprefix/
--expire, E

mc-cmd

Optional

Set the expiration time limit for all generated URLs.

Specify a string with format ##h##m##s format. For example: 12h34m56s for an expiry of 12 hours, 34 minutes, and 56 seconds after URL generation.

Defaults to 168h or 168 hours (7 days).

--recursive, r

mc-cmd

Optional

Recursively generate URLs for all objects in a mc share download ALIAS bucket or bucket prefix.

Required if any ALIAS specifies a path to a bucket or bucket prefix.

--version-id, vid

mc-cmd

Optional

Directs mc share download to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Global Flags

This command supports any of the global flags.

Examples

Generate a URL to Download Object(s)

Use mc share download to generate a URL that supports GET requests for an object:

mc share download --expire DURATION ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the object on the MinIO deployment.
  • Replace DURATION with the duration after which the URL expires. For example, to set a 30 day expiry, specify 30d.

Use mc share download with the --recursive option to generate a URL for each object in a bucket. Each URL supports GET requests for its associated object:

mc share download --recursive --expire DURATION ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix on the MinIO deployment.
  • Replace DURATION with the duration after which the URL expires. For example, to set a 30 day expiry, specify 30d.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

17 - mc support callhome

Description

The mc support callhome command allows the enabling or disabling of diagnostic information from a deployment to MinIO SUBNET.

All mc support commands require an active SUBNET subscription.

When enabled, MinIO sends diagnostic information to SUBNET.

MinIO disables this functionality by default, regardless of registration status. You must explicitly enable the callhome function to begin information upload.

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

mc support callhome enable

mc-cmd

Begin sending a deployment’s diagnostics, logs, or both to SUBNET.

mc support callhome enable    \
                    ALIAS     \
                    [--logs]  \
                    [--diag]
Note

Note

The --logs and --diag flags are no longer supported in SUBNET and will be removed in a future release.

mc support callhome disable

mc-cmd

Stop sending a deployment’s diagnostics, logs, or both to SUBNET.

mc support callhome disable  \
                    ALIAS    \
                    [--logs] \
                    [--diag]
Note

Note

The --logs and --diag flags are no longer supported in SUBNET and will be removed in a future release.

mc support callhome status

mc-cmd

Output whether a deployment currently sends diagnostics, logs, or both to SUBNET.

mc support callhome status   \
                    ALIAS    \
                    [--diag]
Note

Note

The --diag flag is no longer supported in SUBNET and will be removed in a future release.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

--diag

mc-cmd

Optional

Note

Note

This option is no longer supported in SUBNET and will be removed in a future release.

Send or stop sending deployment diagnostic information to SUBNET every 24 hours.

Examples

Enable callhome reporting

Enable sending diagnostic information to SUBNET for a deployment registered to SUBNET with an alias of minio1.

mc support callhome enable minio1

Disable callhome reporting

Disable sending diagnostic information to SUBNET for a deployment registered to SUBNET with an alias of minio1.

mc support callhome disable minio1

Display Current callhome settings

Display whether a deployment with the alias minio1 sends information to SUBNET.

mc support callhome status minio1

Global Flags

This command supports any of the global flags.

18 - mc support top api

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

The mc support top api command summarizes the real-time API events on a MinIO deployment server.

The following command displays the current in-progress S3 API calls on the alias myminio.

mc support top api myminio/

The command has the following syntax:

mc [GLOBALFLAGS] support top api    \
                 TARGET             \
                 [--name "string"]  \
                 [--path "string"]  \
                 [--node "string"]  \
                 [--errors, -e]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias, prefix, or object where the command should run. The path must include at least an ALIAS.

--name

mc-cmd

Optional

Outputs a summary of current API calls matching the entered string.

--path

mc-cmd

Optional

Outputs a summary of current API calls for a specified path.

--node

mc-cmd

Optional

Outputs a summary of the current API calls on matching servers.

--errors, -e

mc-cmd

Optional

Outputs a summary of current API calls returning errors.

Global Flags

This command supports any of the global flags.

Examples

Display All Current In-progress S3 API Calls

The following command displays all in-progress S3 calls for the myminio deployment:

mc support top api myminio/

Display Current, In-progress s3.PutObject Calls

The following command displays all in-progress s3.PutObject calls for the myminio deployment:

mc support top api --name s3.PutObject myminio/

19 - mc tag set

Syntax

The mc tag set command sets one or more tags to a bucket or object.

MinIO supports adding up to 10 custom tags to an object.

The following command sets tags for the mydata bucket on the myminio MinIO deployment:

mc tag set myminio/mydata "tag1=value1&tag2=value2"

The command has the following syntax:

mc [GLOBALFLAGS] tag set                   \
                 [--rewind "string"]       \
                 [--versions]              \
                 [--version-id "string"]*  \
                 ALIAS                     \
                 "TAGS"
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc tag set --version-id is mutually exclusive with multiple parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The alias for a MinIO deployment and the full path to the object on which to apply the tag (e.g. bucket and path to object). For example:

mc tag set myminio/mybucket/object.txt
TAGS

mc-cmd

Required

An ampersand-seperated (&) list of key-value pairs (KEY=VALUE), where each pair represents one tag to assign to the object. For example:

mc tag set myminio/mybucket/object.txt "key1=value1&key2=value2"
--exclude-folders

mc-cmd

Optional

Note

Added: RELEASE.2024-01-11T05-49-32Z

When used with --recursive, causes mc tag set to not traverse child prefixes. Tags are only applied to objects at the specified path. Requires --recursive.

The following example applies the tag destination=international to objects at vacation-photos/cancun/ but not vacation-photos/cancun/ocean/ or other prefixes.

For example, the above would add the tags to the object at vacation-photos/cancun/pretty-beach.jpg but not to the object at vacation-photos/cancun/ocean/tropical-fish.jpg.

mc tag set myminio/vacation-photos/cancun "destination=international" --exclude-folders --recursive
--recursive, r

mc-cmd

Optional

Note

Added: RELEASE.2023-05-04T18-10-16Z

Recursively applies the tag to all objects at the path specified to ALIAS.

--rewind

mc-cmd

Optional

Directs mc tag set to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--versions

mc-cmd

Optional

Directs mc tag set to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to apply the tag all object versions which existed at a specific point in time.

--version-id, --vid

mc-cmd

Optional

Directs mc tag set to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with the following parameters:

Global Flags

This command supports any of the global flags.

Examples

Apply Tags to a Bucket or Object

Use mc tag set to apply tags to a bucket or object:

mc tag set ALIAS/PATH "TAGS"
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or object on the MinIO deployment.
  • Replace TAGS with one or more ampersand-separated (&) key-value pairs for each tag and its corresponding value.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

20 - mc version enable

Syntax

The mc version enable command enables versioning on the specified bucket.

The following command enables versioning for the mybucket bucket on the myminio MinIO deployment:

 mc version enable myminio/mybucket

The command has the following syntax:

mc [GLOBALFLAGS] version enable ALIAS                \
                                --exclude-folders    \
                                --excluded-prefixes
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of a MinIO deployment and the full path to the bucket for which to enable versioning. For example:

mc version enable myminio/mybucket
--exclude-folders

mc-cmd

Optional

Disable versioning on all folders (objects whose name ends with /) in the specified bucket.

--excluded-prefixes

mc-cmd

Optional

Disable versioning on objects matching a list of prefixes, up to 10. The list of prefixes match all objects containing the specified strings in their prefix or name, similar to a regular expression of the form prefix*. To match objects by prefix only, use prefix/*.

For example, the following command excludes any objects containing _test or _temp in their prefix or name from versioning:

mc version enable --excluded-prefixes "_test, _temp" myminio/mybucket

Global Flags

This command supports any of the global flags.

Example

Enable Bucket Versioning

Use mc version enable to enable versioning for a bucket:

mc version enable ALIAS/PATH
  • Replace ALIAS with the alias of a configured MinIO deployment.
  • Replace PATH with the bucket on which to enable versioning.

Behavior

Bucket Versioning with Existing Data

Enabling bucket versioning on a bucket with existing data immediately creates a NULL value version ID for each unversioned object.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

21 - Silo Client Settings

This page covers settings for the MinIO Client.

You can establish or modify settings by defining:

  • an environment variable on the host system prior to starting or restarting the MinIO Server. Refer to your operating system’s documentation for how to define an environment variable.
  • a configuration setting using mc admin config set.

If you define both an environment variable and the similar configuration setting, MinIO uses the environment variable value.

Some settings have only an environment variable or a configuration setting, but not both.

Settings

Host Credentials

Use this setting to add a temporary alias to use for mc commands. For example, for use with scripting.

The temporary alias uses the AWS s3v4 signature.

MC_HOST_<ALIAS>

envvar

Replace <ALIAS> at the end of the environment variable with the alias to set the host for.

This setting does not have a configuration setting option.

Use mc alias set to configure an alias.

Examples

Static Credentials

Syntax
export MC_HOST_<alias>=https://<Access Key>:<Secret Key>@<YOUR-S3-ENDPOINT>
Example
export MC_HOST_myalias=https://Q3AM3UQ867SPQQA43P2F:[email protected]

Security Token Service (STS) Credentials

Syntax
export MC_HOST_<alias>=https://<Access Key>:<Secret Key>:<Session Token>@<YOUR-S3-ENDPOINT>
Example
export MC_HOST_myalias=https://Q3AM3UQ867SPQQA43P2F:zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG:eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJOVUlCT1JaWVRWMkhHMkJNUlNYUiIsImF1ZCI6IlBvRWdYUDZ1Vk80NUlzRU5SbmdEWGo1QXU1WWEiLCJhenAiOiJQb0VnWFA2dVZPNDVJc0VOUm5nRFhqNUF1NVlhIiwiZXhwIjoxNTM0ODk2NjI5LCJpYXQiOjE1MzQ4OTMwMjksImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0Ojk0NDMvb2F1dGgyL3Rva2VuIiwianRpIjoiNjY2OTZjZTctN2U1Ny00ZjU5LWI0MWQtM2E1YTMzZGZiNjA4In0.eJONnVaSVHypiXKEARSMnSKgr-2mlC2Sr4fEGJitLcJF_at3LeNdTHv0_oHsv6ZZA3zueVGgFlVXMlREgr9LXA@play.min.io

STS Service

Note

Added: mc

RELEASE.2023-11-06T04-19-23Z

Use this setting to add an STS endpoint to use for mc commands.

Note

Changed: mc

RELEASE.2023-12-02T02-03-28Z

Supports adding multiple environment variables by alias.

MC_STS_ENDPOINT_<alias>

envvar

export MC_STS_ENDPOINT_myalias=https://sts.minio-operator.svc.cluster.local:4223/sts/ns-1

This setting does not have a configuration setting option.

Web Token Identity

Note

Added: mc

RELEASE.2023-11-06T04-19-23Z

Use this setting to add a web token identity to use for mc commands.

Note

Changed: mc

RELEASE.2023-12-02T02-03-28Z

Supports adding multiple environment variables by alias.

MC_WEB_IDENTITY_TOKEN_<alias>

envvar

export MC_WEB_IDENTITY_TOKEN_FILE_myalias=/var/run/secrets/kubernetes.io/serviceaccount/token

This setting does not have a configuration setting option.

Configuration Directory

Specify the path to the configuration folder the MinIO Client should use.

MC_CONFIG_DIR

envvar

This setting does not have a configuration setting option.

Progress Bar

Disable the MinIO Client progress bar.

MC_QUIET

envvar

This setting does not have a configuration setting option.

Pager

Note

Added: mc

RELEASE.2024-04-29T09-56-05Z

Disable the pager functionality of the MinIO Client in the CLI. When used, output prints to raw STDOUT instead.

MC_DISABLE_PAGER

envvar

This setting does not have a configuration setting option.

Color Theme

Disable the color theme used for MinIO Client output.

MC_NO_COLOR

envvar

This setting does not have a configuration setting option.

JSON

Enable formatting the output as JSON lines.

MC_JSON

envvar

This setting does not have a configuration setting option.

Debug

Enable the debug output.

MC_DEBUG

envvar

This setting does not have a configuration setting option.

Disable SSL

Disable SSL certificate verification.

MC_INSECURE

envvar

This setting does not have a configuration setting option.

Limit Download Bandwidth

Limit the download bandwidth the MinIO Client uses for certain commands.

MC_LIMIT_DOWNLOAD

envvar

This setting does not have a configuration setting option.

If not specified, the MinIO Client uses all available bandwidth.

Limit client-side download rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. This affects only the download from the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes

For example, to limit download rates to no more than 1 GiB/s, use the following on a Linux system:

export MC_LIMIT_DOWNLOAD=1G

Refer to your operating system instructions for equivalent commands on non-Linux systems.

Limit Upload Bandwidth

Limit the upload bandwidth the MinIO Client uses for certain commands.

MC_LIMIT_UPLOAD

envvar

This setting does not have a configuration setting option.

If not specified, the MinIO Client uses all available bandwidth.

Limit client-side upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. This affects only the upload from the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following on a Linux system:

export MC_LIMIT_UPLOAD=1G

Refer to your operating system instructions for equivalent commands on non-Linux systems.

SSE-KMS Encryption

Encrypt and decrypt options using SSE-KMS with server managed keys.

MC_ENC_KMS

envvar

Specify the key with the MC_ENC_KMS environment variable.

This setting does not have a configuration setting option.

SSE-S3 Encryption

Encrypt and decrypt options using SSE-KMS with server managed keys.

MC_ENC_S3

envvar

Specify the key to use for performing SSE-S3 encryption. The specified value must match the encryption key set in MINIO_KMS_KES_KEY_NAME.

This setting does not have a configuration setting option.

22 - mc alias

Description

The mc alias commands provide a convenient interface for managing the list of S3-compatible hosts that mc can connect to and run operations against.

Warning

Important

mc commands that operate on S3-compatible services require specifying an alias for that service.

Subcommands

mc alias includes the following subcommands:

Subcommand

Description

list

The mc alias list command lists all aliases in the local mc configuration.

remove

The mc alias remove removes an existing alias from the local mc configuration.

set

The mc alias set command adds or updates an alias to the local mc configuration.

import

The mc alias import command imports an alias configuration from a JSON document.

export

The mc alias export command exports an alias configuration from the existing configuration.

23 - mc alias remove

Syntax

The mc alias remove removes an existing alias from the local mc configuration.

The following command removes the myminio alias for a MinIO deployment from the host machine:

mc alias remove myminio

The mc alias remove command has the following syntax:

mc [GLOBALFLAGS] alias remove ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The alias to remove from the local mc configuration.

Global Flags

This command supports any of the global flags.

Examples

Remove an Alias from the mc Configuration

Use mc alias remove to remove an existing alias from the mc configuration:

The following command removes the myminio alias.

mc alias remove myminio
mc alias remove ALIAS

Replace ALIAS with the name of the alias to remove.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

24 - mc anonymous get

Syntax

The mc anonymous get command gets the anonymous (i.e. unauthenticated or public) access policies for a bucket.

Buckets with anonymous policies allow clients to access the bucket contents and perform actions consistent with the specified policy without authentication.

To get the JSON policy assigned to the bucket, use the mc anonymous get-json command.

The following command retrieves the anonymous access policy for the mydata bucket on the myminio MinIO deployment:

mc anonymous get myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] policy get ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The full path to the bucket or bucket prefix for which the command retrieves the anonymous bucket policy.

Specify the alias of the MinIO or other S3-compatible service and the full path to the bucket or bucket prefix. For example:

mc anonymous get public play/mybucket

Global Flags

This command supports any of the global flags.

Examples

Get Anonymous Policy for Bucket

Use mc anonymous get to get the anonymous policy for a bucket:

mc anonymous get ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

25 - mc batch describe

Note

Changed: MinIO

RELEASE.2022-10-09T21-10-59Z or later

Syntax

The mc batch describe command outputs the job definition for a specified job ID.

You must specify the job ID. To find the job ID, use mc batch list.

The following command outputs the job definition for the job identified as KwSysDpxcBU9FNhGkn2dCf.

mc batch describe myminio KwSysDpxcBU9FNhGkn2dCf

The command has the following syntax:

mc [GLOBALFLAGS] batch describe TARGET           \
                                JOBID
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The alias for the MinIO deployment to look for the Job ID.

JOBID

mc-cmd

Required

The unique identifier of a job to describe. To find the ID of a job, use mc batch list.

Global Flags

This command supports any of the global flags.

Example

Show the Definition of an In Progress Batch Job

The following command provides the full job definition of a specific job at alias myminio:

mc batch describe myminio KwSysDpxcBU9FNhGkn2dCf
  • Replace myminio with the alias of the MinIO deployment that should run the job.
  • Replace KwSysDpxcBU9FNhGkn2dCf with the ID of the job to define.

The output of the above command is similar to the following:

mc batch describe myminio KwSysDpxcBU9FNhGkn2dCf
replicate:
  apiVersion: v1
...

Note, this example is truncated. The output is the full job definition for the specified job.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Permissions

You must have the admin:DescribeBatchJobs permission to describe jobs on the deployment.

26 - mc encrypt info

Syntax

The mc encrypt info command returns the current default encryption settings for a bucket.

The following command returns the default encryption setting for the mydata bucket on the myminio MinIO deployment.

mc encrypt info myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] encrypt info ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

The full path to the bucket on which to retrieve the default SSE mode. Specify the alias of the MinIO deployment as the prefix to the ALIAS path. For example:

mc encrypt info play/mybucket

Global Flags

This command supports any of the global flags.

Examples

Retrieve the Automatic Server-Side Encryption Settings for a Bucket

 mc encrypt info myminio/data
mc encrypt info ALIAS
  • Replace ALIAS with the alias of the MinIO deployment on which to configure automatic server-side bucket encryption.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

27 - mc event ls

Syntax

The mc event ls command lists all event notification triggers for a bucket.

The alias mc event list has equivalent functionality to mc event ls.

The following command lists all configured event notifications for the specified bucket notification target for the mydata bucket on the myminio MinIO deployment:

mc event ls myminio myminio/mydata arn:aws:sqs::primary:target

The command has the following syntax:

mc [GLOBALFLAGS]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc [GLOBALFLAGS] event ls [FLAGS] ALIAS ARN

Parameters

ALIAS

mc-cmd

Required

The S3 service alias and bucket to which the command lists event notification. For example:

mc event ls play/mybucket ARN...
ARN

mc-cmd

Required

The Amazon Resource Name (ARN) of the bucket resource.

The MinIO server outputs an ARN at startup for each configured notification target. See Bucket Notifications for more information.

Global Flags

This command supports any of the global flags.

Examples

List Event Notifications on a Bucket

The following command lists all event notification triggers on a bucket.

mc event ls myminio/mydata
mc event ls ALIAS ARN
  • Replace ALIAS with the alias of the MinIO deployment on which to add the bucket notification event. For example:

    myminio/mydata

  • Replace ARN with the notification target ARN.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

28 - mc idp ldap accesskey edit

Description

mc idp ldap accesskey edit modifies the specified access key on the local server.

The following example modifies the secret for the access key mykey on the minio deployment:

mc idp ldap accesskey edit myminio/ mykey --secret-key 'xxxxxxx'

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey rm                        \
                                 ALIAS                        \
                                 KEY                          \
                                 [--secret-key <string>]      \
                                 [--policy <string>]          \
                                 [--name <string>]            \
                                 [--description <string>]     \
                                 [--expiry-duration <string>] \
                                 [--expiry <string>]
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Replace KEY with the access key to delete.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey ls minio
KEY

mc-cmd

Required

The configured access key to delete.

--description

mc-cmd

Optional

Add a description for the service account. For example, you might specify the reason the access key exists.

--expiry

mc-cmd

Optional

The date after which the access key expires. Enter the date in YYYY-MM-DD format.

For example, to expire the credentials after December 31, 2024, enter 2024-12-31.

Mutually exclusive with --expiry-duration.

--expiry-duration

mc-cmd

Optional

Length of time the access key pair should remain valid for use in #d#h#s format.

For example, 7d, 24h, 5d12h30s are valid strings.

Mutually exclusive with --expiry.

--name

mc-cmd

Optional

A human-readable name to use for the account.

--policy

mc-cmd

Optional

File path to the JSON-formatted policy to use for the account.

If not specified, the account uses the same policy as the authenticated user.

--secret-key

mc-cmd

Optional

A secret to use for the account.

Example

Modify a secret for an access key

Modify the secret for the access key mykey on the minio deployment.

mc idp ldap accesskey edit myminio/ mykey --secret-key 'xxxxxxx'

Modify the expiration duration for an accesskey

Modify the expiration duration for the access key mykey on the minio deployment.

mc idp ldap accesskey edit myminio/ mykey ---expiry-duration 24h

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

29 - mc idp ldap disable

Description

The mc idp ldap disable command disables the currently configured AD/LDAP provider.

The following example disables the AD/LDAP configurations on the myminio deployment.

mc idp ldap disable  \
            myminio

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap disable  \
                          ALIAS
  • Replace ALIAS with the alias of a MinIO deployment to disable the AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment for which to disable the AD/LDAP integration.

For example:

mc idp ldap disable myminio

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

30 - mc idp ldap policy detach

Description

The mc idp ldap policy detach command detaches one or more polices from an entity.

The following example detaches the policy userpolicy from the user bobfisher on the myminio deployment.

mc idp ldap policy detach myminio                                                  \
                          userpolicy                                               \
                          --user='uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io'

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap policy detach             \
                                 POLICYNAME         \
                                 [POLICY2] ...      \
                                 ALIAS              \
                                 [--user=`USER`]    \
                                 [--group=`GROUP`]
  • Replace ALIAS with the alias of a MinIO deployment to configure for AD/LDAP integration.

  • Replace POLICYNAME with the policy to detach from the entity. You may list multiple policies to detach from the entity.

  • Use must use one of either the --user or --group flag. You may only use the flag once in the command. You cannot use both flags in the same command.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment with the entity from which to detach a policy.

For example:

mc idp ldap policy detach myminio                                                  \
                          userpolicy                                               \
                          --user='uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io'

Example

The following example detaches two policies, policy1 and policy2, from the projectb group on the myminio deployment:

mc idp ldap policy detach myminio                                                 \
                          policy1                                                 \
                          policy2                                                 \
                          --group='cn=projectb,ou=groups,ou=swengg,dc=min,dc=io'

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

31 - mc ilm rule

Note

Changed: RELEASE.2022-12-24T15-21-38Z

The following commands have moved to subcommands under mc ilm rule:

Description

The mc ilm rule command and its subcommands configure the rules used to transition objects between storage tiers in MinIO’s Lifecycle Management.

Before creating rules with this command, use mc ilm tier and its subcommands to create the tier or tiers of other object storage locations where objects move.

For more information, see the overview of lifecycle management.

Subcommands

mc ilm rule includes the following subcommands:

Subcommand

Description

add

The mc ilm rule add command adds an object lifecycle management rule to a bucket.

edit

The mc ilm rule edit command modifies an existing object lifecycle management rule on a MinIO bucket.

export

The mc ilm rule export command exports the object lifecycle management configuration for a MinIO bucket.

import

The mc ilm rule import command imports an object lifecycle management configuration and applies it to a MinIO bucket.

ls

The mc ilm rule ls command summarizes all configured object lifecycle management rules on a MinIO bucket in a tabular format.

rm

The mc ilm rule rm command removes an object lifecycle management rule from a MinIO Bucket.

Permissions

MinIO requires the following permissions scoped to the bucket or buckets for which you create lifecycle management rules.

For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:.

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "admin:SetTier",
               "admin:ListTier"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteTierManagement"
      },
      {
            "Action": [
               "s3:PutLifecycleConfiguration",
               "s3:GetLifecycleConfiguration"
            ],
            "Resource": [
                        "arn:aws:s3:::*"
            ],
            "Effect": "Allow",
            "Sid": "EnableLifecycleManagementRules"
      }
   ]
}

Transition Permissions

Object transition lifecycle management rules require additional permissions on the remote storage tier. Specifically, MinIO requires the remote tier credentials provide read, write, list, and delete permissions.

For example, if the remote storage tier implements AWS IAM policy-based access control, the following policy provides the necessary permission for transitioning objects into and out of the remote tier:

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "s3:ListBucket"
            ],
            "Effect": "Allow",
            "Resource": [
               "arn:aws:s3:::MyDestinationBucket"
            ],
            "Sid": ""
      },
      {
            "Action": [
               "s3:GetObject",
               "s3:PutObject",
               "s3:DeleteObject"
            ],
            "Effect": "Allow",
            "Resource": [
               "arn:aws:s3:::MyDestinationBucket/*"
            ],
            "Sid": ""
      }
   ]
}

Modify the Resource for the bucket into which MinIO tiers objects.

Defer to the documentation for the supported tiering targets for more complete information on configuring users and permissions to support MinIO tiering:

32 - mc ilm rule edit

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm rule edit replaces mc ilm edit.

Syntax

The mc ilm rule edit command modifies an existing object lifecycle management rule on a MinIO bucket.

The following command modifies existing lifecycle management rules for the mydata bucket on the myminio deployment:

mc ilm rule edit --id "c79ntj94b0t6rukh6lr0" --expiry-days 90  myminio/mydata

mc ilm rule edit --id "c79nu2p4b0t6qko19rgg" --expired-object-delete-marker myminio/mydata

mc ilm rule edit --id "c79n19dn10dnab109fg1" --transition-days 30 --tier "COLDTIER"

The command modifies the specified rules as follows:

  • Delete objects more than 90 days old.
  • Delete DeleteMarker tombstones if that object has no other versions remaining.
  • Transition objects more than 30 days old to the COLDTIER remote tier.

The command has the following syntax:

mc [GLOBALFLAGS] ilm rule edit                                       \
                 --id "string"                                       \
                 [--prefix "string"]                                 \
                 [--enable]                                          \
                 [--disable]                                         \
                 [--expire-all-object-versions]                      \
                 [--expire-days "string"]                            \
                 [--expire-delete-marker]                            \
                 [--transition-days "string"]                        \
                 [--transition-tier "string"]                        \
                 [--noncurrent-expire-days "string"]                 \
                 [--noncurrent-expire-newer "string"]                \
                 [--noncurrent-transition-days "string"]             \
                 [--noncurrent-transition-tier "string"]             \
                 [--tags]                                            \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias and full path to the bucket on the MinIO deployment to which to modify the object lifecycle management rule. For example:

mc ilm rule edit myminio/mydata
--id

mc-cmd

Required

The unique ID of the rule. Use mc ilm rule ls to list bucket rules and retrieve the id for the rule you want to modify.

--disable

mc-cmd

Optional

Stop using the rule, but retain the rule for future use. Objects do not transition or expire when a rule is disabled.

--enable

mc-cmd

Optional

Use a rule to transition or expire objects.

--prefix

mc-cmd

Optional

Restrict the management rule to a specific bucket prefix.

For example:

mc ilm rule edit --prefix "meetingnotes/" myminio/mydata --expire-days "90"

The command modifies a rule that expires objects in the mydata bucket of the myminio ALIAS after 90 days for any object with the meetingnotes/ prefix.

--expire-all-object-versions

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-02-24T01-33-20Z

Expire all current and noncurrent versions of an object. Use with the --expire-days option to specify the number of days after which all versions of an object should be deleted by the scanner process.

After the scanner processes this command, no versions of the object remain on the deployment.

Note

Added: MinIO

RELEASE.2024-05-01T01-11-10Z

This flag only applies to objects that do not have a delete marker as the latest version.

--expire-days

mc-cmd

Optional

The number of days to retain an object after being created. MinIO marks the object for deletion after the specified number of days pass.

Exercise caution when using this option, as its behavior can result in immediate expiration of uploaded objects. Any objects created after the specified expiration date are automatically eligible for expiration. Similarly, specifying a calendar date that is prior to the current system host datetime marks all objects covered by the rule for deletion. Consider immediately removing any ILM rule using this option once the specified calendar date has passed.

For versioned buckets, the expiry rule applies only to the current object version. Use the --noncurrent-expire-days option to apply expiration behavior to noncurrent object versions.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

Mutually exclusive with the following options:

--expire-delete-marker

mc-cmd

Optional

Specify this option to direct MinIO to remove delete markers for objects with no remaining object versions. Specifically, the delete marker is the only remaining “version” of the given object.

This option is mutually exclusive with the following options:

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner and Object Deletion for more information.

--noncurrent-expire-days

mc-cmd

Optional

The number of days to retain an object version after becoming non-current (i.e. a different version of that object is now the HEAD). MinIO marks noncurrent object versions for deletion after the specified number of days pass.

This option has the same behavior as the S3 NoncurrentVersionExpiration action.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrent-expire-newer

mc-cmd

Optional

The number of non-current versions of an object to retain before applying expiration. Older non-current versions beyond the specified number expire.

By default, MinIO does not retain any non-current versions when an expiration rule applies.

--noncurrent-transition-days

mc-cmd

Optional

The number of days an object has been non-current (i.e. replaced by a newer version of that same object) after which MinIO marks the object version as eligible for transition. MinIO transitions the object to the configured remote storage tier specified to the --transition-tier once the system host datetime passes that calendar date.

This option has no effect on non-versioned buckets. Requires specifying --noncurrent-transition-tier.

This option has the same behavior as the S3 NoncurrentVersionTransition action.

If the remote tier is another MinIO deployment, you can set the value to 0 to mark new objects as immediately eligible for transition to the remote tier.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrent-transition-tier

mc-cmd

Optional

The remote storage tier to which MinIO transitions noncurrent objects versions. Specify a remote storage tier created by mc ilm tier add.

MinIO does not automatically migrate objects from the previously specified remote tier to the new remote tier. MinIO continues to route requests for objects stored on the old remote tier.

--tags

mc-cmd

Optional

One or more ampersand &-delimited key-value pairs describing the object tags to which to apply the lifecycle configuration rule.

This option is mutually exclusive with the following option:

--transition-days

mc-cmd

Optional

The number of calendar days from object creation after which MinIO marks an object as eligible for transition. MinIO transitions the object to the configured remote storage tier specified to the --transition-tier. Specify the number of days as an integer, e.g. 30 for 30 days. If the remote tier is another MinIO deployment, you can set the value to 0 to mark new objects as immediately eligible for transition to the remote tier.

For versioned buckets, the transition rule applies only to the current object version. Use the --noncurrent-transition-days option to apply transition behavior to noncurrent object versions.

Requires specifying --transition-tier.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--transition-tier

mc-cmd

Optional

The remote storage tier to which MinIO transition objects. Specify a remote storage tier created by mc ilm tier add.

Required if specifying --transition-days.

MinIO does not automatically migrate objects from the previously specified remote tier to the new remote tier. MinIO continues to route requests for objects stored on the old remote tier.

Global Flags

This command supports any of the global flags.

Examples

Modify an Existing Lifecycle Management Rule

Use mc ilm rule edit with --id to modify an existing object expiration rule:

mc ilm rule edit ALIAS/PATH --id "RULEID" [FLAGS]
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket on the S3-compatible host.
  • Replace RULEID with the unique ID of the object lifecycle management rule. Use mc ilm rule ls to find the RULEID.
  • Specify any additional flags to add or modify the lifecycle management rule. For example, specify --transition-days to override the existing transition days value for the rule.

Disable a Lifecycle Management Rule

Use mc ilm rule edit with --disable to stop using an existing management rule.

mc ilm rule edit --id "RULEID" --disable myminio/mybucket
  • Replace RULEID with the unique ID of the object lifecycle management rule. Use mc ilm rule ls to find the RULEID.
  • Replace myminio with the ALIAS of the deployment where the rule exists.
  • Replace mybucket with the bucket for the rule.

Required Permissions

For permissions required to edit a rule, refer to the required permissions on the parent command.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

33 - mc ilm tier check

Description

The mc ilm tier check command displays the configuration for remote tier on a deployment.

Syntax

The command has the following syntax:

The following example displays the configuration for an existing remote tier called WARM-TIER on the myminio deployment.

 mc ilm tier check myminio WARM-TIER

The command has the following syntax:

mc ilm tier add TARGET TIER_NAME
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

The command accepts the following arguments:

TARGET

mc-cmd

Required

The alias of a configured MinIO deployment on which the desired tier exists.

TIER_NAME

mc-cmd

Required

The name of an existing remote tier to display.

You must specify the tier in all-caps, e.g. WARM_TIER.

Global Flags

This command supports any of the global flags.

Example

Display the Configuration for an Existing Tier

The following example displays the configuration of the tier WARM-TIER on the myminio deployment.

mc ilm tier check myminio WARM-TIER

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Permissions

For permissions required to review a tier, refer to the required permissions on the parent command.

34 - mc legalhold info

Syntax

The mc legalhold info command returns the current legal hold setting for an object or objects.

mc legalhold requires that the specified bucket has object locking enabled. You can only enable object locking at bucket creation. See mc mb --with-lock for documentation on creating buckets with object locking enabled.

The following command retrieves the current legalhold status for objects in the mydata bucket on the myminio MinIO deployment:

mc legalhold info --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] legalhold info  \
                 [--recursive]   \
                 [--rewind]      \
                 [--version-id]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The MinIO alias and path to the object or objects on which to enable the legal hold. For example:

mc legalhold info play/mybucket/myobjects/objects.txt
--recursive, r

mc-cmd

Optional

Returns the legal hold status of all objects in the ALIAS bucket or bucket prefix.

--rewind

mc-cmd

Optional

Directs mc legalhold info to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, vid

mc-cmd

Optional

Directs mc legalhold info to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Global Flags

This command supports any of the global flags.

Examples

Use mc legalhold info to retrieve the legal hold status of an object. Include --recursive to return the legal hold status of the contents of a bucket:

mc legalhold clear [--recursive] ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the --recursive option.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

35 - mc license register

Warning

Important

mc license register requires MinIO Client version RELEASE.2023-11-20T16-30-59Z or later. While not strictly required, best practice keeps the MinIO Client version in alignment with the MinIO Server version.

Description

The mc license register command connects your deployment with your MinIO SUBNET account.

After registration, you can upload deployment health reports directly to SUBNET using the mc support diag command.

The following example registers the minio alias with MinIO SUBNET:

mc license register minio

The command has the following syntax:

mc [GLOBALFLAGS] license register ALIAS                      \
                         [--airgap]                          \
                         [--api-key <string>]                \
                         [--license <path to license file>]  \
                         [--name <value>]

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

--airgap

mc-cmd

Optional

Use in environments without network access to SUBNET (for example, airgapped, firewalled, or similar configuration).

For instructions, see the airgap example.

If the deployment is airgapped, but the local device where you are using the minio client has network access, you do not need to use the --airgap flag.

--api-key

mc-cmd

API key of the account on SUBNET.

Corresponds with the MC_SUBNET_API_KEY environment variable.

To find the API key:

  1. Log in to MinIO SUBNET
  2. Go to the Deployments tab
  3. Select the API Key button near the top of the page on the right side of the account statistics information box
  4. Select copy button to the right of the key field to copy the key value to your clipboard
--license

mc-cmd

Optional

Path to the license file to use for registering the deployment.

You must first download the license file for the account from MinIO SUBNET.

  1. Log in to MinIO SUBNET
  2. Go to the Deployments tab
  3. Select the License button near the top of the page on the right side of the account statistics information box
  4. Select the copy button to the right of the license field to copy the key value to your clipboard or select the Download button to save a txt file of the license locally
--name

mc-cmd

Optional

Specify a name other than the alias to associate to the MinIO deployment in SUBNET.

Use --name <value> replacing <value> with the name you want to use for the deployment on SUBNET.

Examples

Register a Deployment Using the Deployment’s Name

Register the MinIO deployment at alias minio1 on SUBNET, using minio1 as the deployment name:

mc license register minio1

If not already registered, a prompt asks for SUBNET credentials for the deployment.

Register a Deployment Using the Account’s License File

Register a new MinIO deployment at alias minio5 on SUBNET, using the license file downloaded for the account:

mc license register minio5 /path/to/minio.license

If not already downloaded, you can download the license file from SUBNET.

  1. Log in to MinIO SUBNET
  2. Go to the Deployments tab
  3. Select the License button near the top of the page on the right side of the account statistics information box
  4. Select the Download button to save a txt file of the license locally

Register a Deployment with a Different Deployment Name

Register a MinIO deployment at alias minio2 on SUBNET, using second-deployment as the name:

mc license register minio2 --name second-deployment

Register a Deployment Without Direct Internet Access

Register a MinIO deployment at alias minio3 on SUBNET that does not have direct Internet access due to a firewall, airgap, or the like.

Note

Changed: mc

RELEASE.2022-07-29T19-17-16Z

The airgap registration process works with MinIO Client version RELEASE.2022-07-29T19-17-16Z or later. Earlier versions of the MinIO Client cannot register an airgapped deployment.

mc license register minio3 --airgap
  1. Run the command to return a registration link with token

  2. Open the copied registration link in a web browser and sign in to SUBNET

  3. Select the ? button to the right of the License number for the deployment

  4. In the popup, select the download link and save the key to a path you have access to

  5. In the command line, run the following command

    mc license update minio3 <path-to-file>

    Replace <path-to-file> with the path to the file you downloaded from SUBNET.

Syntax

The command has the following syntax:

mc [GLOBALFLAGS] license register       \
                         ALIAS          \
                         [--name value] \
                         [--airgap]

Global Flags

This command supports any of the global flags.

Behavior

Automatic License Updates

Note

Added: RELEASE.2023-01-18T04-36-38Z

Once registered for MinIO SUBNET, MinIO automatically checks for and updates the license every month.

In airgapped or other environments where the server does not have direct access to the internet, use mc license update with the path to the file to update the registration.

36 - mc replicate backlog

Note

Changed: mc.RELEASE.2023-07-18T21-05-38Z

mc replicate diff has been renamed mc replicate backlog. No functionality has changed.

Description

The mc replicate backlog shows a list of unreplicated new or deleted objects.

You can list the replication status of objects for a particular remote target. To do so, you must have the ARN of the remote target. You can use retrieve the remote targets configured for a bucket to find the ARN.

Syntax

The following command shows new or deleted objects in the notes bucket of the teamorange/projects prefix on the myminio alias that have not yet replicated to a specific remote target bucket. The remote target’s ARN is arn:minio:replication::3bb8c736-4014-42c5-b3cb-d64e3ebaa75e:notes.

mc replicate backlog myminio/notes/teamorange/projects --arn arn:minio:replication::3bb8c736-4014-42c5-b3cb-d64e3ebaa75e:notes

If any new or deleted objects have not yet replicated, the command outputs something similar to the following:

[0001-01-01 00:00:00 UTC] [2022-10-06 17:18:59 UTC]          478efe49-aa9d-46ab-8268-45b70cc4c341 PUT agenda.docx
[0001-01-01 00:00:00 UTC] [2022-10-06 17:18:15 UTC]          b283bf43-319f-455a-a779-3c2e669fad88 PUT budget-meeting.docx

In the output, PUT corresponds to a new object. Deleted objects or versions would show DEL.

The command has the following syntax:

mc [GLOBALFLAGS] replicate backlog   \
                 [--arn "string"]    \
                 TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The path to the alias, prefix, or object.

arn

mc-cmd

Optional

The ARN of the remote bucket to check for new or deleted objects that have not yet replicated.

When specified, the command returns a list of any new or deleted objects that have not replicated to the remote target. If not specified, the command returns a list of new or deleted objects on the source deployment that have not replicated to any remote target.

Global Flags

This command supports any of the global flags.

Examples

View Unreplicated Versions of Objects at a Prefix

Display unreplicated PUT and DELETE actions for a prefix:

mc replicate backlog myminio/mybucket/path/to/prefix
  • Replace myminio/mybucket with the ALIAS and full bucket path for which to create the replication configuration.
  • Replace path/to/prefix with the prefix or object to use for the request.

If unreplicated objects exist, the output returns a list of the actions that created or removed objects at the prefix that have not replicated to a remote target:

[0001-01-01 00:00:00 UTC] [2022-10-06 17:18:59 UTC]          478efe49-aa9d-46ab-8268-45b70cc4c341 PUT agenda.docx
[0001-01-01 00:00:00 UTC] [2022-10-06 17:18:15 UTC]          b283bf43-319f-455a-a779-3c2e669fad88 PUT budget-meeting.docx

View Unreplicated Objects at a Specific Remote Target

The following mc replicate backlog command shows unreplicated objects at an alias/bucket/prefix path for a specific remote target:

mc replicate backlog myminio/mybucket/path/to/prefix --arn <remote-arn>
  • Replace myminio/mybucket with the ALIAS and full bucket path for which to show unreplicated objects.
  • Replace the path/to/prefix with the desired prefix or object path.
  • Replace <remote-arn> with the resource number for a specific remote target.

If unreplicated objects exist, the output returns a list of the actions that created or removed objects that have not replicated to the remote target:

[0001-01-01 00:00:00 UTC] [2022-10-06 17:18:59 UTC]          478efe49-aa9d-46ab-8268-45b70cc4c341 PUT agenda.docx
[0001-01-01 00:00:00 UTC] [2022-10-06 17:18:15 UTC]          b283bf43-319f-455a-a779-3c2e669fad88 PUT budget-meeting.docx

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

37 - mc retention info

Syntax

The mc retention info command configures the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also set the default object lock settings for a bucket, where all objects without explicit object lock settings inherit the bucket default.

To lock an object under legal hold, use mc legalhold set.

mc retention info requires that the specified bucket has object locking enabled. You can only enable object locking at bucket creation. See mc mb --with-lock for documentation on creating buckets with object locking enabled.

The following command returns the default object lock configuration for the mydata bucket on the myminio MinIO deployment:

mc retention info --default myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] retention info            \
                 [--default]               \
                 [--recursive]             \
                 [--rewind "string"]       \
                 [--version-id "string"]*  \
                 [--versions]              \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc retention info --version-id is mutually exclusive with multiple other parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The full path to the object for which to retrieve the object lock configuration. Specify the alias of a configured S3-compatible service as the prefix to the ALIAS bucket path. For example:

mc retention info play/mybucket/object.txt
  • If the ALIAS specifies a bucket or bucket prefix, include

    --recursive to return the object lock settings for all objects in the bucket or bucket prefix.

  • If the ALIAS bucket has versioning enabled,

    mc retention info by default applies to only the latest object version. Use --version-id or --versions to return the object lock settings for a specific version or for all versions of the object.

--default

mc-cmd

Optional

Returns the default object lock settings for the bucket specified to ALIAS.

If specifying --default, mc retention info ignores all other flags.

--recursive, r

mc-cmd

Optional

Recursively returns the object lock settings for all objects in the specified ALIAS path.

Mutually exclusive with --version-id.

--rewind

mc-cmd

Optional

Directs mc retention info to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, vid

mc-cmd

Optional

Directs mc retention info to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with any of the following flags:

--versions

mc-cmd

Optional

Directs mc retention info to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to retrieve the retention settings for all object versions that existed at a specific point-in-time.

Global Flags

This command supports any of the global flags.

Examples

Retrieve Object Lock Settings for an Object or Object(s)

mc retention info ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the object.

Use mc retention info with --recursive to retrieve the retention settings for all objects in a bucket:

mc retention info --recursive ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the bucket.

The bucket must have object locking enabled to use this command. You can only enable object locking when creating a bucket. See mc mb --with-lock for more information on creating buckets with object locking enabled.

Retrieve Default Object Lock Settings for a Bucket

Use mc retention info with --default to retrieve the default object lock settings for a bucket:

mc retention info --default ALIAS/PATH
  • Replace ALIAS with the

    alias of a configured S3-compatible host.

  • Replace PATH with the path to the bucket.

The bucket must have object locking enabled to use this command. You can only enable object locking when creating a bucket. See mc mb --with-lock for more information on creating buckets with object locking enabled.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

38 - mc share upload

Syntax

The mc share upload command generates a temporary presigned URL with integrated access credentials for uploading objects to a MinIO bucket. The temporary URL expires after a configurable time limit.

Applications can perform a PUT to upload an object using the URL.

For more information on shareable object URLs, see the Amazon S3 documentation on Pre-Signed URLs.

The following command generates a new presigned upload URL for the mydata bucket on the myminio MinIO deployment:

mc share upload --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] share upload               \
                 [--content-type "string"]  \
                 [--expire "string"]        \
                 [--recursive]              \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The alias of a MinIO deplyment and the full path to the object for which to generate an upload URL. For example:

mc share upload play/mybucket/object.txt

You can specify multiple objects on the same or different MinIO deployments. For example:

mc share upload play/mybucket/object.txt play/mybucket/otherobject.txt

If specifying the path to a bucket or bucket prefix, you must also specify the --recursive argument. For example:

mc share upload --recursive play/mybucket/

mc share upload --recursive play/mybucket/myprefix/
--content-type, T

mc-cmd

Optional Restrict uploads to only requests with a specific Content-Type header.

Specify a string with the desired Content-Type value to accept. For example, video/mp4.

If configured, clients using the generated URL must include a Content-Type header for the specified type. MinIO rejects requests that do not have the correct Content-Type header.

Content types are also known as media types.

--expire, E

mc-cmd

Optional Set the expiration time limit for all generated URLs.

Specify a string with format ##h##m##s format. For example: 12h34m56s for an expiry of 12 hours, 34 minutes, and 56 seconds after URL generation.

Defaults to 168h or 168 hours (7 days).

--recursive, r

mc-cmd

Optional Modifies the CURL URL to support uploading objects to a bucket or bucket prefix. Required if any ALIAS specifies a path to a bucket or bucket prefix. The modified CURL output resembles the following:

curl ... -F key=<NAME> -F file=@<FILE>

Replace <FILE> with the path to the file to upload.

Replace <NAME> with the object name once uploaded. This may include prefixes.

Global Flags

This command supports any of the global flags.

Examples

Generate a URL to Upload Object(s)

Use mc share upload to generate a URL that supports POST requests for uploading a file to a specific object location on a MinIO deployment:

mc share upload --expire DURATION ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the object on the MinIO deployment.
  • Replace DURATION with the duration after which the URL expires. For example, to set a 30 day expiry, specify 30d.

Use mc share upload with the --recursive and --expire options to generate a temporary URL that supports POST requests for uploading files to a bucket on a MinIO deployment:

mc share upload --recursive --expire DURATION ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix on the MinIO deployment.
  • Replace DURATION with the duration after which the URL expires. For example, to set a 30 day expiry, specify 30d.

The command returns a CURL command for uploading an object to the specified bucket prefix.

  • Replace the <FILE> string in the returned CURL command with the path to the file to upload.
  • Replace the <NAME> string in the returned CURL command with the name of the object in the bucket. This may include prefixes.

You can use a shell script loop to recursively upload the contents of a filesystem directory to the S3-compatible service:

#!/bin/sh

for file in ~/Documents/photos/
do
   curl https://play.min.io/mybucket/ \
   -F policy=AAAAA -F x-amz-algorithm=AWS4-HMAC-SHA256 \
   -F x-amz-credential=AAAA/us-east-1/s3/aws4_request \
   -F x-amz-date=20200812T202556Z \
   -F x-amz-signature=AAAA \
   -F bucket=mybucket -F key=photos/${file} -F file=@${file}

done

This example will upload each file in the directory ~/Documents/photos/ to the mybucket bucket under the prefix photos. Defer to the documented best practices for your preferred scripting language for iterating through files in a directory.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

39 - mc support diag

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Command History

The command used to create the diagnostic report has changed over time.

MinIO Client Release Command Notes
RELEASE.2022-02-13T23-26-13Z mc support diag Command moved to mc support
RELEASE.2020-11-17T00-39-14Z mc admin subnet health Command made a SUBNET subcommand
RELEASE.2020-10-03T02-54-56Z mc admin health Command renamed to health
Original Command mc admin obd Command renamed mc admin health

Description

The mc support diag command generates a health report for a MinIO deployment.

For deployments registered with the MinIO subscription network (SUBNET), the command generates and uploads the health report for analysis. Optionally, automate generating and uploading the report every 24 hours by enabling callhome.

The resulting health report is intended for use by MinIO Engineering via SUBNET and may contain internal or private data points. Exercise caution before sending a health report to a third party or posting the health report in a public forum.

MinIO recommends that you run the health diagnostics when first provisioning the cluster and again at any failure scenario.

Use the mc support diag command to trigger the diagnostic test. For clusters registered with SUBNET, the command uploads the results as part of SUBNET Health reports.

For airgapped or firewalled environments, or other environments that prevent direct network access from the deployment, you can save the report locally with the --airgap flag. After saving, you can then upload the results of the test to SUBNET manually.

Sample Output

● CPU Info ... ✔
● Disk Info ... ✔
● Net Info ... ✔
● Os Info ... ✔
● Mem Info ... ✔
● Process Info ... ✔
● Server Config ... ✔
● System Errors ... ✔
● System Services ... ✔
● System Config ... ✔
● Admin Info ... ✔
*********************************************************************************
                                WARNING!!
     ** THIS FILE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR ENVIRONMENT **
     ** PLEASE INSPECT CONTENTS BEFORE SHARING IT ON ANY PUBLIC FORUM **
*********************************************************************************
mc: MinIO diagnostics report saved to myminio-health_20231111053323.json.gz

The gzipped output contains the requested health information.

Examples

Generate Health Data for a Cluster and Automatically Upload to SUBNET

Generate health data for a MinIO cluster and automatically for a MinIO cluster at alias minio1 for transmission to SUBNET.

mc support diag minio1

The automatic upload of data only occurs for deployments under a Commerical License.

Generate Health Data for a Cluster to Upload Manually

Generate a diagnostic report for a MinIO deployment at alias minio2 and save it for manual upload to SUBNET:

mc support diag minio2 --airgap
  1. Run the command to download the .gzip file
  2. Login to https://subnet.min.io and select the Deployments section
  3. Select the deployment for the report
  4. Select the Upload button
  5. Drag and drop the file or browse to the .gzip file location to upload it

Upload Data to SUBNET with Strict Anonymization

Generates health data for a MinIO cluster at alias myminio and anonymizes all sensitive data, including host names.

mc support diag myminio --anonymize=strict

Syntax

The command has the following syntax:

mc [GLOBALFLAGS] support diag                   \
                         ALIAS                  \
                         [--airgap]             \
                         [--anonymize=<string>] \
                         [--api-key string]

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

--airgap

mc-cmd

Optional

Use in environments without network access to SUBNET (for example, airgapped, firewalled, or similar configuration). Generates the diagnostic report and saves it to the location where you ran the command.

You must manually upload the report to SUBNET.

For instructions, see the airgap example.

If the deployment is airgapped, but the local device where you are using the minio client has network access, you do not need to use the --airgap flag.

--anonymize

mc-cmd

Note

Added: mc

RELEASE.2023-11-10T21-37-17Z

MinIO anonymizes data loaded to SUBNET. Beginning with mc RELEASE.2023-11-10T21-37-17Z, MinIO does not anonymize host names. This is the default standard anonymization mode.

Valid values are =strict or =standard.

To anonymize all data, including host names, pass this parameter with the strict mode.

mc support diag minio --anonymize=strict
--api-key

mc-cmd

Optional

Takes the account’s API key value from SUBNET.

This value is only required for airgapped environments where MinIO has not already stored the API key for the deployment.

Global Flags

This command supports any of the global flags.

40 - mc support top locks

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

The mc support top locks command lists the ten oldest locks on a MinIO deployment.

The command outputs the age of the lock, type of lock, owner, and resource. The output resembles the following:

Since                 Type    Owner                 Resource
13 hours ago          WRITE   10.68.100.18:9000     .minio.sys/leader.lock
13 hours ago          WRITE   10.68.100.18:9000     .minio.sys/callhome/runCallhome.lock
13 hours ago          WRITE   10.68.100.23:9000     .minio.sys/new-drive-healing/0/0

The following command displays the current in-progress S3 API calls on the alias myminio.

mc support top locks myminio/

The command has the following syntax:

mc [GLOBALFLAGS] support top locks  \
                 [--stale]          \
                 TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--stale

mc-cmd

Optional

Return only stale locks.

Global Flags

This command supports any of the global flags.

Examples

Display the 10 Oldest Locks on the myminio Deployment

mc support top locks myminio/

Display Stale Locks on the myminio Deployment

The following command displays all in-progress s3.PutObject calls for the myminio deployment:

mc support top locks --stale myminio/

41 - mc tag list

Syntax

The mc tag list command lists all tags from a bucket or object.

The following command lists tags for the mydata bucket on the myminio MinIO deployment:

mc tag list myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] tag set                   \
                 [--rewind "string"]       \
                 [--versions]              \
                 [--version-id "string"]*  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc tag list --version-id is mutually exclusive with multiple parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The alias for a MinIO deployment and the full path to the object for which to list all tags (e.g. bucket and path to object). For example:

mc tag list myminio/mybucket/object.txt
--recursive, r

mc-cmd

Optional

Note

Added: RELEASE.2023-05-04T18-10-16Z

Recursively lists the tags for all objects at the path specified to ALIAS.

--rewind

mc-cmd

Optional

Directs mc tag list to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--versions

mc-cmd

Optional

Directs mc tag list to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to list tags from all object versions which existed at a specific point in time.

--version-id, vid

mc-cmd

Optional

Directs mc tag list to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with the following parameters:

Global Flags

This command supports any of the global flags.

Examples

List Tags for a Bucket or Object

Use mc tag list to list tags for a bucket or object:

mc tag list ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or object on the MinIO deployment.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

42 - mc version info

Syntax

The mc version info command returns the versioning status for the specified bucket.

The following command returns the versioning status for the mybucket bucket on the myminio MinIO deployment:

mc version info myminio/mybucket

The command has the following syntax:

mc [GLOBALFLAGS] version info ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

The full path to the bucket on which to retrieve the versioning status. For example:

mc version info myminio/mybucket

Global Flags

This command supports any of the global flags.

Example

Get Bucket Versioning Status

Use mc version info to retrieve the versioning status for a bucket:

mc version info ALIAS/PATH
  • Replace ALIAS with the alias of a configured MinIO deployment.
  • Replace PATH with the bucket on which to retrieve the versioning status.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

43 - mc alias set

Syntax

The mc alias set command adds or updates an alias to the local mc configuration.

The following command adds an alias for a MinIO deployment myminio running at the URL https://myminio.example.net. mc uses the specified username and password for authenticating to the MinIO deployment:

mc alias set myminio https://myminio.example.net minioadminuser minioadminpassword

If the myminio alias already exists, the command overwrites that alias with the new URL, access key, and secret key.

The mc alias set command has the following syntax:

mc [GLOBALFLAGS] alias set \
                 [--api "string"]                           \
                 [--path "string"]                          \
                 ALIAS                                      \
                 URL                                        \
                 ACCESSKEY                                  \
                 SECRETKEY
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The name to associate with the S3-compatible service. Aliases are case-sensitive and must meet the following requirements:

  • Contain only ASCII lower case letters (a-z), upper case letters (A-Z), numbers ([0-9]), hyphen (-), or underscore (_).
  • 2 or more characters in length.
  • The first character must be a letter.
Note

Changed: RELEASE.2024-01-11T05-49-32Z

An alias may also be a single letter (a-z or A-Z).

Examples of some valid alias values include:

  • myminio
  • Test-1
  • A
  • a
URL

mc-cmd

Required The URL to the S3-compatible service endpoint. For example:

https://minio.example.net

ACCESSKEY

mc-cmd

Required

The access key for authenticating to the S3 service.

SECRETKEY

mc-cmd

Required

The secret key for authenticating to the S3 service.

--api

mc-cmd

Optional

Specifies the signature calculation method to use when connecting to the S3-compatible service. Supports the following values:

  • S3v4 (Default)
  • S3v2
Note

Note

AWS Signature V2 is considered deprecated by AWS. mc alias set includes this option only for S3 buckets or services still reliant on the Signature V2.

Use S3v4 unless explicitly required by the S3-compatible service. MinIO server does not rely on nor require S3v2, nor are all API operations available on S3v2.

--path

mc-cmd

Optional

Specifies the bucket path lookup setting used by the server. Supports the following values:

  • "auto" (Default)
  • "on"
  • "off"

Global Flags

This command supports any of the global flags.

Examples

Add or Update an Alias for a MinIO Deployment

Use mc alias set to add an S3-compatible service for use with mc:

The following command creates a new alias myminio pointing at a MinIO deployment at https://minio.example.net. The alias uses the miniouser and miniopassword credentials for performing operations against the deployment.

mc alias set myminio https://minio.example.net miniouser miniopassword

If the myminio alias already exists, the mc alias set command overwrites that alias with the specified arguments.

mc alias set ALIAS HOSTNAME ACCESSKEY SECRETKEY
  • Replace ALIAS with the name to associate with the MinIO service.
  • Replace HOSTNAME with the URL for any node in the MinIO deployment. You can alternatively specify the URL for a load balancer or reverse proxy managing connections to the MinIO deployment.
  • Replace ACCESSKEY and SECRETKEY with credentials for a user on the MinIO deployment.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Credentials and Access Control

mc alias set requires specifying an access key and corresponding secret key for the S3-compatible host. mc functionality is limited based on the policies associated to the specified credentials. For example, if the specified credentials do not have read/write access to a specific bucket, mc cannot perform read or write operations on that bucket.

For more information on MinIO Access Control, see Access Management.

For more complete documentation on S3 Access Control, see Amazon S3 Security.

For all other S3-compatible services, defer to the documentation for that service.

Certificates

The MinIO Client fetches the peer certificate, computes the public key fingerprint, and asks the user whether to accept the deployment’s certificate.

If trusted, the MinIO Client automatically adds the certificate authority to:

  • ~/.mc/certs/CAs/ on Linux and other Unix-like systems.
  • C:\Users\[username]\mc\certs\CAs\ on Windows systems.

44 - mc anonymous

Description

The mc anonymous command supports setting or removing anonymous policies to a bucket and its contents. Buckets with anonymous policies allow public access where clients can perform any action granted by the policy without authentication.

Subcommands

mc anonymous includes the following subcommands:

Subcommand

Description

get

The mc anonymous get command gets the anonymous (i.e. unauthenticated or public) access policies for a bucket.

get-json

The mc anonymous get-json command gets anonymous (i.e. unauthenticated or public) access policies for a bucket.

links

The mc anonymous links retrieves the HTTP URL for anonymous (i.e. unauthenticated or public) access to a bucket.

list

The mc anonymous list retrieves all anonymous (i.e. unauthenticated or public) access policies for a bucket.

set

The mc anonymous set command sets anonymous (i.e. unauthenticated or public) access policies for a bucket.

set-json

The mc anonymous set-json command sets anonymous (i.e. unauthenticated or public) access policies for a bucket using an IAM JSON policy document.

45 - mc anonymous list

Syntax

The mc anonymous list retrieves all anonymous (i.e. unauthenticated or public) access policies for a bucket.

Buckets with anonymous policies allow clients to access the bucket contents and perform actions consistent with the specified policy without authentication.

The following command lists all anonymous access policies for the mydata bucket on the myminio MinIO deployment:

mc anonymous list myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The full path to the bucket or bucket prefix for which the command retrieves the anonymous bucket policies.

Specify the alias of the MinIO or other S3-compatible service and the full path to the bucket or bucket prefix. For example:

mc anonymous list public play/mybucket

Global Flags

This command supports any of the global flags.

Examples

List Anonymous Policies for Bucket

Use mc anonymous list to list the anonymous policies for a bucket:

mc anonymous list ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

46 - mc batch generate

Note

Changed: MinIO

RELEASE.2022-10-09T21-10-59Z or later

Syntax

The mc batch generate command creates a basic YAML-formatted template file for the specified job type.

After MinIO creates the file, open it in your preferred text editor tool to further customize. You can define one job task definition per batch file.

See job types for the supported jobs you can generate.

The following command creates a basic YAML file for a replicate job on the mybucket bucket of the myminio alias.

mc batch generate myminio replicate

The command has the following syntax:

mc [GLOBALFLAGS] batch generate \
                       ALIAS   \
                       JOBTYPE
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias used to generate the YAML template file. The specified alias does not restrict the deployment(s) where you can use the generated file.

For example:

mc batch generate myminio replicate
JOBTYPE

mc-cmd

Required

The type of job to generate a YAML document for.

Supports the following values:

Global Flags

This command supports any of the global flags.

Examples

Generate a yaml File for a Replicate Job Type

The following command generates a YAML blueprint for a replicate type batch job and names the file replicate with the .yaml extension:

mc batch generate alias replicate > replicate.yaml
  • Replace alias with the alias to use to generate the yaml file.

  • Replace replicate with the type of job to generate a yaml file for.

    :mc:mc batch supports the replicate and keyrotate job types.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Job Types

mc batch currently supports the following job task types:

  • replicate

    Replicate objects between two MinIO deployments. Provides similar functionality to bucket replication as a batch job rather than continual scanning function.

  • keyrotate

    Note

    Added: MinIO

    RELEASE.2023-04-07T05-28-58Z

    Rotate the sse-s3 or sse-kms keys for objects at rest on a MinIO deployment.

  • expire

    Note

    Added: MinIO

    RELEASE.2023-12-02T10-51-33Z

    Expire objects based using similar semantics as Automatic Object Expiration.

replicate

You can use the following example configuration as the starting point for building your own custom replication batch job:

replicate:
  apiVersion: v1
  # source of the objects to be replicated
  source:
    type: TYPE # valid values are "s3" or "minio"
    bucket: BUCKET
    prefix: PREFIX # 'PREFIX' is optional
    # If your source is the 'local' alias specified to 'mc batch start', then the 'endpoint' and 'credentials' fields are optional and can be omitted
    # Either the 'source' or 'remote' *must* be the "local" deployment
    endpoint: "http[s]://HOSTNAME:PORT" 
    # path: "on|off|auto" # "on" enables path-style bucket lookup. "off" enables virtual host (DNS)-style bucket lookup. Defaults to "auto"
    credentials:
      accessKey: ACCESS-KEY # Required
      secretKey: SECRET-KEY # Required
    # sessionToken: SESSION-TOKEN # Optional only available when rotating credentials are used
    snowball: # automatically activated if the source is local
      disable: false # optionally turn-off snowball archive transfer
      batch: 100 # upto this many objects per archive
      inmemory: true # indicates if the archive must be staged locally or in-memory
      compress: false # S2/Snappy compressed archive
      smallerThan: 5MiB # create archive for all objects smaller than 5MiB
      skipErrs: false # skips any source side read() errors

  # target where the objects must be replicated
  target:
    type: TYPE # valid values are "s3" or "minio"
    bucket: BUCKET
    prefix: PREFIX # 'PREFIX' is optional
    # If your source is the 'local' alias specified to 'mc batch start', then the 'endpoint' and 'credentials' fields are optional and can be omitted

    # Either the 'source' or 'remote' *must* be the "local" deployment
    endpoint: "http[s]://HOSTNAME:PORT"
    # path: "on|off|auto" # "on" enables path-style bucket lookup. "off" enables virtual host (DNS)-style bucket lookup. Defaults to "auto"
    credentials:
      accessKey: ACCESS-KEY
      secretKey: SECRET-KEY
    # sessionToken: SESSION-TOKEN # Optional only available when rotating credentials are used

  # NOTE: All flags are optional
  # - filtering criteria only applies for all source objects match the criteria
  # - configurable notification endpoints
  # - configurable retries for the job (each retry skips successfully previously replaced objects)
  flags:
    filter:
      newerThan: "7d" # match objects newer than this value (e.g. 7d10h31s)
      olderThan: "7d" # match objects older than this value (e.g. 7d10h31s)
      createdAfter: "datetime" # match objects created after this date and time in RFC3339 format
      createdBefore: "datetime" # match objects created before this date and time in RFC3339 format

      ## NOTE: tags are not supported when "source" is remote.
      # tags:
      #   - key: "name"
      #     value: "pick*" # match objects with tag 'name', with all values starting with 'pick'

      # metadata:
      #   - key: "content-type"
      #     value: "image/*" # match objects with 'content-type', with all values starting with 'image/'

    notify:
      endpoint: "https://notify.endpoint" # notification endpoint to receive job status events
      token: "Bearer xxxxx" # optional authentication token for the notification endpoint

    retry:
      attempts: 10 # number of retries for the job before giving up
      delay: "500ms" # least amount of delay between each retry

See Replicate Batch Job Reference for more complete documentation on each key.

keyrotate

You can use the following example configuration as the starting point for building your own custom key rotation batch job:

keyrotate:
  apiVersion: v1
  bucket: BUCKET
  prefix: PREFIX
  encryption:
    type: sse-s3 # valid values are sse-s3 and sse-kms
    key: <new-kms-key> # valid only for sse-kms
    context: <new-kms-key-context> # valid only for sse-kms

  # optional flags based filtering criteria
  # for all objects
  flags:
    filter:
      newerThan: "7d" # match objects newer than this value (e.g. 7d10h31s)
      olderThan: "7d" # match objects older than this value (e.g. 7d10h31s)
      createdAfter: "date" # match objects created after this date and time in RFC3339 format
      createdBefore: "date" # match objects created before this date and time in RFC3339 format
      tags:
        - key: "name"
          value: "pick*" # match objects with tag 'name', with all values starting with 'pick'
      metadata:
        - key: "content-type"
          value: "image/*" # match objects with 'content-type', with all values starting with 'image/'
      kmskey: "key-id" # match objects with KMS key-id (applicable only for sse-kms)
    notify:
      endpoint: "https://notify.endpoint" # notification endpoint to receive job status events
      token: "Bearer xxxxx" # optional authentication token for the notification endpoint
    retry:
      attempts: 10 # number of retries for the job before giving up
      delay: "500ms" # least amount of delay between each retry

See Key Rotate Batch Job Reference for more complete documentation on each key.

expire

You can use the following example configuration as a starting point for building your own custom expiration batch job:

expire:
  apiVersion: v1
  bucket: mybucket # Bucket where this job will expire matching objects from
  prefix: myprefix # (Optional) Prefix under which this job will expire objects matching the rules below.
  rules:
    - type: object  # objects with zero ore more older versions
      name: NAME # match object names that satisfy the wildcard expression.
      olderThan: 70h # match objects older than this value
      createdBefore: "2006-01-02T15:04:05.00Z" # match objects created before this date and time in RFC3339 format
      tags:
        - key: name
          value: pick* # match objects with tag 'name', all values starting with 'pick'
      metadata:
        - key: content-type
          value: image/* # match objects with 'content-type', all values starting with 'image/'
      size:
        lessThan: 10MiB # match objects with size less than this value (e.g. 10MiB)
        greaterThan: 1MiB # match objects with size greater than this value (e.g. 1MiB)
      purge:
          # retainVersions: 0 # (default) delete all versions of the object. This option is the fastest.
          # retainVersions: 5 # keep the latest 5 versions of the object.

    - type: deleted # objects with delete marker as their latest version
      name: NAME # match object names that satisfy the wildcard expression.
      olderThan: 10h # match objects older than this value (e.g. 7d10h31s)
      createdBefore: "2006-01-02T15:04:05.00Z" # match objects created before this date and time in RFC3339 format
      purge:
          # retainVersions: 0 # (default) delete all versions of the object. This option is the fastest.
          # retainVersions: 5 # keep the latest 5 versions of the object including delete markers.

  notify:
    endpoint: https://notify.endpoint # notification endpoint to receive job completion status
    token: Bearer xxxxx # optional authentication token for the notification endpoint

  retry:
    attempts: 10 # number of retries for the job before giving up
    delay: 500ms # least amount of delay between each retry

See Expire Batch Job Reference for more complete documentation on each key.

47 - mc encrypt set

Syntax

The mc encrypt set encrypt command sets or updates the default bucket Server-Side Encryption (SSE) mode. MinIO automatically encrypts objects written to that bucket using the specified SSE mode.

mc encrypt set only supports SSE-KMS and SSE-S3.

The following command sets the default SSE-KMS encryption key for the bucket mydata on the myminio MinIO deployment:

mc encrypt set sse-kms "minio-encryption-key" myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] encrypt set  ENCRYPTION [KMSKEY] ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ENCRYPTION

mc-cmd

Specify the server-side encryption type to use as the default SSE mode. Supports the following values:

  • sse-kms - Encrypt objects using the key specified in KMSKEY. MinIO must have access to the specified key on the external KMS to successfully encrypt or decrypt objects protected using SSE-KMS.
  • sse-s3 - Encrypt objects using the key specified to MINIO_KMS_KES_KEY_NAME. MinIO must have access to the specified key on the external KMS to successfully encrypt or decrypt objects protected using SSE-S3.
KMSKEY

mc-cmd

Specify the KMS Master Key to use for performing SSE object encryption. This option only applies if ENCRYPTION is sse-kms.

Omit this option to direct MinIO to use the MINIO_KMS_KES_KEY_NAME.

ALIAS

mc-cmd

The full path to the bucket on which to set the default SSE mode. Specify the alias of the MinIO deployment as the prefix to the TARGET path. For example:

mc encrypt set ENCRYPTION [KMSKEY] play/mybucket

Global Flags

This command supports any of the global flags.

Examples

Enable Automatic Server-Side Bucket Encryption

The following commands assumes that:

  • The MinIO server configuration supports SSE-KMS
  • The root has an encryption key minio-encryption-key.
 mc encrypt set sse-kms minio-encryption-key myminio/data
mc encrypt set ENCRYPTION KMSKEY TARGET
  • Replace ENCRYPTION with sse-kms or sse-s3 depending on the preferred encryption mode.
  • Replace KMSKEY with the name of the encryption key on the configured root KMS. This argument has no effect with sse-s3.
  • Replace TARGET with the alias of the MinIO deployment on which to configure automatic server-side bucket encryption.

Behavior

mc encrypt set makes no assumptions about the MinIO server’s current encryption state. Specifying default encryption settings which the server cannot support may result in undesired behavior.

Setting or modifying the default server-side encryption settings does not automatically encrypt or decrypt the existing bucket contents. If the bucket contents must have consistent encryption, use the mc mv command with --enc-kms, --enc-s3, or --enc-c to specify the type of encryption to use for the moved contents. This manually modifies the encryption settings or encrypted state of the bucket contents before changing the bucket default.

48 - mc event rm

Syntax

The mc event rm command removes an event notification trigger from a bucket.

The mc event remove command has equivalent functionality to mc event rm.

The following command removes a configured event notifications for the specified bucket notification target for the mydata bucket on the myminio MinIO deployment:

mc event rm myminio/mydata arn:aws:sqs::primary:target

The command has the following syntax:

mc [GLOBALFLAGS] event remove        \
                 ALIAS               \
                 [ARN]               \
                 [--event "string"]  \
                 [--force]           \
                 [--prefix "string"] \
                 [--suffix "string"]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc [GLOBALFLAGS] event remove [FLAGS] ALIAS ARN

Parameters

ALIAS

mc-cmd

Required

The S3 service alias and bucket from which the command removes the event notification. For example:

mc event rm play/mybucket
ARN

mc-cmd

Required

The Amazon Resource Name (ARN) of the notification target.

The MinIO server outputs an ARN at startup for each configured notification target. See Bucket notifications for more information.

Retrieve the ARN by running mc event ls on the bucket.

--event

mc-cmd

Optional

The event type(s) specified when the event was added. The entries must match the values used when adding the event. If no event matches the list of event types, the command returns a no notification configuration matched error.

Specify multiple events using a comma , delimiter. See Supported Bucket Events for supported event types.

Defaults to removing an event that triggers for all event types on the ALIAS bucket with the ARN notification target.

Retrieve the event types used by running mc event ls on the bucket. Use the following table to convert event types in the command’s output to the entry required for the mc event rm command:

Output of mv event ls Event type to use
s3:objectAccessed get
s3:objectCreated put
s3:objectRemoved delete

For example, if the mc event ls returns the following:

arn:minio:sqs::mytest:webhook   s3:ObjectAccessed:*,s3:ObjectCreated:*   Filter:

Use the following command to remove the event:

mc event rm alias/bucket arn:minio:sqs::mytest:webhook --event get,put

The order of event types does not matter, only that you include the same ones that exist for the event.

--force

mc-cmd

Optional

Removes all events on the ALIAS bucket with the ARN notification target.

--prefix

mc-cmd

Optional

The bucket prefix in which the command removes bucket notifications.

For example, given a ALIAS of play/mybucket and a --prefix of photos, the command only removes bucket notifications in play/mybucket/photos.

--suffix

mc-cmd

Optional

The bucket suffix in which the command removes bucket notifications.

For example, given a ALIAS of play/mybucket and a --suffix of .jpg, the command only removes bucket notifications in play/mybucket/*.jpg.

Global Flags

This command supports any of the global flags.

Examples

Remove Event Notifications from a Bucket

The following command removes all event notification triggers on a bucket. The command assumes the MinIO deployment has at least one configured bucket notification target:

mc event rm myminio/mydata arn:minio:sqs::primary:webhook
mc event rm ALIAS ARN
  • Replace ALIAS with the alias of the MinIO deployment on which to add the bucket notification event. For example:

    myminio/mydata

  • Replace ARN with the notification target ARN.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

49 - mc idp ldap accesskey enable

Description

The mc idp ldap accesskey enable enables the specified access key on the local server.

The following example enables the access key mykey from the minio deployment:

mc idp ldap accesskey enable minio/ mykey

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey enable  \
                                 ALIAS      \
                                 KEY
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Replace KEY with the access key to enable.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey enable minio mykey
KEY

mc-cmd

Required

The configured access key to enable.

Example

Enable the access key mykey from the minio deployment.

mc idp ldap accesskey enable minio/ mykey

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

50 - mc idp ldap enable

Description

The mc idp ldap enable command enables the currently configured AD/LDAP provider.

The following example enables the AD/LDAP configurations on the myminio deployment.

mc idp ldap enable   \
            myminio

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap enable  \
                          ALIAS
  • Replace ALIAS with the alias of a MinIO deployment to enable the AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment for which to enable the AD/LDAP integration.

For example:

mc idp ldap enable myminio

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

51 - mc idp ldap policy entities

Description

The mc idp ldap policy entities command displays a list of mappings for a user, group, and/or policy.

The following example lists all mappings for a specific policy, a set of groups, and a selection of users on the myminio deployment.

Specifically, it lists:

  • Users mapped to the finteam-policy policy.
  • Policies assigned to the uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io user.
  • Policies assigned to the cn=projectb,ou=groups,ou=swengg,dc=min,dc=io group.
mc idp ldap policy entities myminio                                                  \
                            --policy finteam-policy                                  \
                            --user 'uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io'  \
                            --group 'cn=projectb,ou=groups,ou=swengg,dc=min,dc=io'

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap policy entities                       \
                                 ALIAS                          \
                                 [--group `value`, -g `value`]  \
                                 [--policy value]               \
                                 [--user `value`, -u `value`]
  • Replace ALIAS with the alias of a MinIO deployment to configure for AD/LDAP integration.

  • You may use each of the --user, --group, and/or --policy flags as many times as desired in the command.

  • For each flag, the output lists the entities mapped to the specified policy, user, or group.

  • Omit all flags to return a list of mappings for all policies.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment for which to display the entity mappings.

For example:

mc idp ldap policy entities myminio
--group

mc-cmd

Optional

Returns a list of users and policies associated with the specified group. Repeat the flag to return a list for multiple groups.

--policies

mc-cmd

Optional

Returns a list of users and groups associated with the specified policy. Repeat the flag to return a list for multiple policies.

--user

mc-cmd

Optional

Returns a list of groups to which the user belongs and the policies associated with each group. The output includes only groups assigned to policies.

Repeat the flag to return a list for multiple users.

Example

The following example lists the entities mapped to each of two policies, policy1 and policy2 and entities mapped to the projectb group on the myminio deployment:

mc idp ldap policy entities myminio                                                 \
                          policy1                                                 \
                          policy2                                                 \
                          --group='cn=projectb,ou=groups,ou=swengg,dc=min,dc=io'

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

52 - mc ilm rule export

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm rule export replaces mc ilm export.

Syntax

The mc ilm rule export command exports the object lifecycle management configuration for a MinIO bucket.

The mc ilm rule export command outputs to STDOUT by default. You can output the contents to a .json file for archival or ingestion using mc ilm rule import.

The following command exports the lifecycle management configuration of the mydata bucket on the myminio deployment to the mydata-lifecycle-config.json file:

mc ilm rule export myminio/mydata > mydata-lifecycle-config.json

The command has the following syntax:

mc [GLOBALFLAGS] ilm rule export ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias and full path to the bucket on the MinIO deployment for which to export object lifecycle management rules. For example:

mc ilm rule export myminio/mydata > bucket-lifecycle.json

Global Flags

This command supports any of the global flags.

Examples

Export the Bucket Lifecycle Management Configuration

The following command exports the bucket lifecycle management configuration to the bucket-lifecycle.json file:

mc ilm rule export myminio/mybucket > bucket-lifecycle.json
mc ilm rule export ALIAS > file.json
  • Replace ALIAS with the alias of the MinIO deployment and the bucket for which to export object lifecycle management rules:

    myminio/mydata

  • Replace file.json with the name of the file to which to export the lifecycle management rules.

Required Permissions

For permissions required to export a rule, refer to the required permissions on the parent command.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

53 - mc ilm tier

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm tier replaces mc admin tier.

Description

The mc ilm tier command and its subcommands configure a remote supported S3-compatible service for MinIO Lifecycle Management: Object Transition (“Tiering”).

After creating one or more tiers with this command, use mc ilm rule and its subcommands to create the rules that move objects to other storage.

For more information, see the overview of lifecycle management.

Subcommands

mc ilm tier includes the following subcommands:

Subcommand

Description

add

The mc ilm tier add command creates a new remote storage tier to a supported storage services.

check

The mc ilm tier check command displays the configuration for remote tier on a deployment.

info

The mc ilm tier info command outputs statistics about a tier or all tiers for a deployment.

ls

The mc ilm tier ls command shows the remote tiers configured on a deployment.

rm

The mc ilm tier rm command removes an remote tier that has not been used to transition any objects.

update

The mc ilm tier update command modifies an existing configured remote tier.

Required Permissions

To create tiers for object transition, MinIO requires the following administrative permissions on the cluster:

For example, the following policy provides sufficient permissions for configuring object transition lifecycle management rules on any bucket in the cluster:

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "admin:SetTier",
               "admin:ListTier"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteTierManagement"
      },
      {
            "Action": [
               "s3:PutLifecycleConfiguration",
               "s3:GetLifecycleConfiguration"
            ],
            "Resource": [
                        "arn:aws:s3:::*"
            ],
            "Effect": "Allow",
            "Sid": "EnableLifecycleManagementRules"
      }
   ]
}

Transition Permissions

Object transition lifecycle management rules require additional permissions on the remote storage tier. Specifically, MinIO requires the remote tier credentials provide read, write, list, and delete permissions.

For example, if the remote storage tier implements AWS IAM policy-based access control, the following policy provides the necessary permissions for transitioning objects into and out of the remote tier:

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "s3:ListBucket"
            ],
            "Effect": "Allow",
            "Resource": [
               "arn:aws:s3:::MyDestinationBucket"
            ],
            "Sid": ""
      },
      {
            "Action": [
               "s3:GetObject",
               "s3:PutObject",
               "s3:DeleteObject"
            ],
            "Effect": "Allow",
            "Resource": [
               "arn:aws:s3:::MyDestinationBucket/*"
            ],
            "Sid": ""
      }
   ]
}

Modify the Resource for the bucket into which MinIO tiers objects.

Note

Avoid enabling versioning in the remote tier

MinIO strongly recommends against enabling bucket versioning for remote tiers. If the remote tier bucket is versioned, each source object version is transitioned to a unique object in the remote tier.

If your environment requires versioning for the remote tier, you must also allow the s3:DeleteObjectVersion permission.

Defer to the documentation for the supported tiering targets for more complete information on configuring users and permissions to support MinIO tiering:

54 - mc ilm tier info

Description

The mc ilm tier info command outputs statistics about a tier or all tiers for a deployment.

Required Permissions

MinIO requires the following permissions scoped to the bucket or buckets for which you are creating lifecycle management rules.

MinIO also requires the following administrative permissions on the cluster in which you are creating remote tiers for object transition lifecycle management rules:

For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:.

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "admin:SetTier",
               "admin:ListTier"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteTierManagement"
      },
      {
            "Action": [
               "s3:PutLifecycleConfiguration",
               "s3:GetLifecycleConfiguration"
            ],
            "Resource": [
                        "arn:aws:s3:::*"
            ],
            "Effect": "Allow",
            "Sid": "EnableLifecycleManagementRules"
      }
   ]
}

Syntax

The command has the following syntax:

The following example outputs the configuration for an existing remote tier called WARM-TIER on the myminio deployment.

 mc ilm tier info myminio WARM-TIER

The command has the following syntax:

mc ilm tier info TARGET TIER_NAME

Parameters

The command accepts the following arguments:

TARGET

mc-cmd

Required

The alias of a configured MinIO deployment on which the desired tier exists.

TIER_NAME

mc-cmd

Optional

The name of an existing remote tier to display.

You must specify the tier in all-caps, e.g. WARM_TIER.

If not specified, MinIO lists statistics for all existing tiers on the deployment.

Global Flags

This command supports any of the global flags.

Example

Display the Statistics for an Existing Tier

The following example displays the statistics of the tier WARM-TIER on the myminio deployment.

mc ilm tier info myminio WARM-TIER

Display the Statistics for all Existing Tiers on a Deployment

The following example displays the statistics of all existing tiers on the myminio deployment.

mc ilm tier info myminio

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Permissions

For permissions required to review a tier, refer to the required permissions on the parent command.

55 - mc legalhold set

Syntax

The mc legalhold set command enables legal hold Write-Once Read-Many (WORM) object locking on an object or objects.

mc legalhold requires that the specified bucket has object locking enabled. You can only enable object locking at bucket creation. See mc mb --with-lock for documentation on creating buckets with object locking enabled.

The following command enables legalhold WORM locking on all existing objects in the mydata bucket on the myminio MinIO deployment:

mc legalhold set --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] legalhold set  \
                 [--recursive]  \
                 [--rewind]     \
                 [--version-id] \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The MinIO alias and path to the object or objects on which to enable the legal hold. For example:

mc legalhold set play/mybucket/myobjects/objects.txt
--recursive, r

mc-cmd

Optional

Applies the legal hold to all existing objects in the ALIAS bucket or bucket prefix.

Note

--recursive only applies to existing objects

To enable legal hold for future objects, periodically repeat the mc legalhold command as new objects are created.

--rewind

mc-cmd

Optional

Directs mc legalhold set to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, vid

mc-cmd

Optional

Directs mc legalhold set to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Global Flags

This command supports any of the global flags.

Examples

Use mc legalhold set to enable legal hold on objects:

mc legalhold set [--recursive] ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the --recursive option.

Behavior

Legal holds are indefinite and enforce complete immutability for locked objects. Only privileged users with the s3:PutObjectLegalHold can set or lift the legal hold.

Legal holds are complementary to both GOVERNANCE Mode and COMPLIANCE Mode retention settings. An object held under both legal hold and a GOVERNANCE/COMPLIANCE retention rule remains WORM locked until the legal hold is lifed and the rule expires.

For GOVERNANCE locked objects, the legal hold prevents mutating the object even if the user has the necessary privileges to bypass retention.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

56 - mc license update

Description

Use the mc license update command to replace a license key for a deployment.

For deployments registered for MinIO SUBNET, MinIO automatically checks for and updates the license every month.

Examples

Update the License Key for a Deployment with Alias minio1

mc license update minio1 license.key

Syntax

The command has the following syntax:

mc [GLOBALFLAGS] license update                   \
                         ALIAS                    \
                         [LICENSE-FILE-WITH-PATH] \
                         [--airgap]

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

LICENSE-FILE-WITH-PATH

mc-cmd

Optional

The path (relative to the current working directory) and file name of the key to use to update the deployment’s license.

To download the API key from SUBNET:

  1. Log in to MinIO SUBNET
  2. Go to the Deployments tab
  3. Select the API Key button near the top of the page on the right side of the account statistics information box
  4. Select copy button to the right of the key field to copy the key value to your clipboard
--airgap

mc-cmd

Optional

Use in environments without network access to SUBNET (for example, airgapped, firewalled, or similar configuration).

If the deployment is airgapped, but the local device where you are using the minio client has network access, you do not need to use the --airgap flag.

Global Flags

This command supports any of the global flags.

57 - mc replicate ls

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc replicate ls replaces the mc admin bucket remote ls command.

Syntax

The mc replicate ls command lists all replication rules on a MinIO bucket.

The mc replicate list command has equivalent functionality to mc replicate ls.

The following command lists all enabled replication rules for the mydata bucket on the myminio MinIO deployment:

mc replicate ls --status "enabled" myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] replicate ls         \
                 [--status "string"]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment and full path to the bucket or bucket prefix for which to list the replication rules. For example:

mc replicate ls myminio/mybucket
--status

mc-cmd

Optional

Filter replication rules on the bucket based on their status. Specify one of the following values:

  • enabled - Show only enabled replication rules.
  • disabled - Show only disabled replication rules.

If omitted, mc replicate ls defaults to showing all replication rules.

Global Flags

This command supports any of the global flags.

Examples

List Existing Replication Rules

Use mc replicate ls to list bucket replication rules:

mc replicate ls ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

58 - mc retention clear

Syntax

The mc retention clear command removes the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also remove the default object lock settings for a bucket.

To change the retention status of an object under legal hold, use mc legalhold clear.

The following command removes the default object lock configuration for the mydata bucket on the myminio MinIO deployment:

mc retention clear --default myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] retention clear           \
                 [--default]               \
                 [--recursive]             \
                 [--rewind "string"]       \
                 [--version-id "string"]*  \
                 [--versions]              \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc retention clear --version-id is mutually exclusive with multiple other parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The full path to the object or objects for which to clear the object lock configuration. Specify the alias of a configured S3-compatible service as the prefix to the ALIAS bucket path. For example:

mc retention clear play/mybucket/object.txt
  • If the ALIAS specifies a bucket or bucket prefix, include

    --recursive to clear the object lock settings to the bucket contents.

  • If the ALIAS bucket has versioning enabled,

    mc retention clear by default applies to only the latest object version. Use --version-id or --versions to clear the object lock settings for a specific version or for all versions of the object.

--default

mc-cmd

Optional

Clears the default object lock settings for the bucket specified to ALIAS.

If specifying --default, mc retention clear ignores all other flags.

--recursive, r

mc-cmd

Optional

Recursively clears the object lock settings for all objects in the specified ALIAS path.

Mutually exclusive with --version-id.

--rewind

mc-cmd

Optional

Directs mc retention clear to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, vid

mc-cmd

Optional

Directs mc retention clear to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with any of the following flags:

--versions

mc-cmd

Optional

Directs mc retention clear to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to remove the retention settings from all object versions that existed at a specific point-in-time.

Global Flags

This command supports any of the global flags.

Examples

Clear Object Lock Settings for an Object or Object(s)

mc retention clear ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the object.

Use mc retention clear with --recursive to clear the retention settings from all objects in a bucket:

mc retention clear --recursive ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the bucket.

The bucket must have object locking enabled to use this command. You can only enable object locking when creating a bucket. See mc mb --with-lock for more information on creating buckets with object locking enabled.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

59 - mc share ls

Syntax

The mc share ls command displays any unexpired presigned URLs generated by mc share upload or mc share download

The mc share list command has equivalent functionality to mc share ls.

Applications can perform a PUT to retrieve the object from the URL.

For more information on shareable object URLs, see the Amazon S3 documentation on Pre-Signed URLs.

The following command lists all upload and download presigned URLs respectively for the mydata bucket on the myminio MinIO deployment:

mc share ls upload myminio/mydata
mc share ls download myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] share list           \
                 [download | upload]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

download

mc-cmd

Required Lists all unexpired presigned download (GET) URLs.

Mutually exclusive with mc share ls upload

upload

mc-cmd

Required Lists all unexpired presigned upload (PUT) URLs.

Mutually exclusive with mc share ls download

ALIAS

mc-cmd

Required The alias of a MinIO deplyment and the full path to the object for which to list unexpired presigned URLs.

Global Flags

This command supports any of the global flags.

Examples

List Generated Download and Upload URLs

Use mc share ls download to generate a URL that supports POST requests for uploading a file to a specific object location on an S3-compatible host:

mc share ls download ALIAS
  • Replace ALIAS with the alias of the MinIO deployment.

Use mc share ls upload to generate a URL that supports POST requests for uploading a file to a specific object location on an S3-compatible host:

mc share ls upload ALIAS
  • Replace ALIAS with the alias of the MinIO deployment.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

60 - mc support inspect

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Description

The mc support inspect command collects the data and metadata associated to objects at the specified path.

MinIO assembles this data from each backend drive storing an erasure shard for each specified object. The command produces an encrypted zip file that includes all matching files with their respective host+drive+path.

If this information is required to diagnose a MinIO SUBNET issue, MinIO Engineering will provide the appropriate command. The resulting report is intended for use by MinIO Engineering via SUBNET and may contain internal or private data points associated to the object. Exercise caution before sending a report to a third party or posting the report in a public forum.

Note

Changed: RELEASE.2023-01-11T03-14-16Z

The file uploads to MinIO for use by the engineering team in support efforts. If the upload fails, such as in an air-gapped environment, the command saves the file to the current working directory.

Note

Changed: RELEASE.2022-12-12T19-27-27Z

When writing the zip archive, MinIO also encrypts the zip index of file names included in the archive.

Note

Changed: RELEASE.2024-10-29T15-34-59Z

Inspect now generates unique file names to help distinguish one inspect file from another. The file name reflects the inspected path.

Warning

Important

mc support inspect requires a MinIO deployment server from October 2021 or later.

Wildcards

The command supports wildcard * pattern matching for prefixes or objects when using the Bash shell. For non-Bash shells, a message displays indicating that wildcard patterns are only supported in Bash.

mc support inspect ALIAS/bucket/path/**/xl.meta

This command collects all xl.meta associated to objects at ALIAS/bucket/path/.

Examples

Download Metadata for an Object

You can download the metadata for an object. Metadata stores in an xl.meta binary file.

The following command downloads the xl.meta from mybucket/myobject on the minio1 deployment.

The file downloads from all drives as a zip archive file.

mc support inspect minio1/mybucket/myobject/xl.meta

The contents of the xl.meta file are not human readable. You can convert the contents of an xl.meta file to JSON format.

Download All Objects at a Prefix Recursively

The following command downloads all objects recursively found at a prefix.

Caution

Caution

This can be an expensive operation. Proceed with caution.

mc support inspect minio1/mybucket/myobject/**

Syntax

The command has the following syntax:

mc [GLOBALFLAGS] support inspect       \
                         [--legacy]   \
                         TARGET

Parameters

--legacy

mc-cmd

Optional

Use the older method of exporting inspection data, which does not encrypt data by default.

TARGET

mc-cmd

Required

The path to the location or object to inspect. The path should include the alias <alias> of the MinIO deployment and, if needed, the prefix and/or object name.

Global Flags

This command supports any of the global flags.

61 - mc support top disk

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

The mc support top disk command displays current drive statistics.

The following command displays the current in-progress S3 API calls on the alias myminio.

mc support top disk myminio/

The command has the following syntax:

mc [GLOBALFLAGS] support top disk                     \
                             [--count, -c "integer"]  \
                             TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--count, -c

mc-cmd

Optional

Display statistics for up to the entered number of drives.

If no entry is made, the command returns statistics for up to 10 drives.

Global Flags

This command supports any of the global flags.

62 - mc tag remove

Syntax

The mc tag remove command removes all tags from a bucket or object.

The following command removes tags for the mydata bucket on the myminio MinIO deployment:

mc tag remove myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] tag remove                \
                 [--rewind "string"]       \
                 [--versions]              \
                 [--version-id "string"]*  \
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc tag remove --version-id is mutually exclusive with multiple parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The alias for a MinIO deployment and the full path to the object on which to remove all tags (e.g. bucket and path to object). For example:

mc tag remove myminio/mybucket/object.txt
--recursive, r

mc-cmd

Optional

Note

Added: RELEASE.2023-05-04T18-10-16Z

Recursively removes all tags from all objects at the specified ALIAS.

--rewind

mc-cmd

Optional

Directs mc tag remove to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--versions

mc-cmd

Optional

Directs mc tag remove to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to remove tags from all object versions which existed at a specific point in time.

--version-id, vid

mc-cmd

Optional

Directs mc tag remove to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with the following parameters:

Global Flags

This command supports any of the global flags.

Examples

Remove Tags from a Bucket or Object

Use mc tag remove to remove tags from a bucket or object:

mc tag remove ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or object on the MinIO deployment.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

63 - mc version suspend

Syntax

The mc version suspend command disables versioning on the specified bucket.

The following command disables versioning for the mybucket bucket on the myminio MinIO deployment:

mc version suspend myminio/mybucket

The command has the following syntax:

mc [GLOBALFLAGS] version suspend ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

The full path to the bucket on which to disable versioning. For example:

mc version suspend myminio/mybucket

Global Flags

This command supports any of the global flags.

Example

Disable Bucket Versioning

Use mc version suspend to disable versioning for a bucket:

mc version suspend ALIAS/PATH
  • Replace ALIAS with the alias of a configured MinIO deployment.
  • Replace PATH with the bucket on which to disable versioning.

Behavior

Bucket Versioning with Existing Data

Disabling bucket versioning on a bucket with existing versioned data does not remove any versioned objects. Applications can continue to access versioned data after disabling bucket versioning. Use mc rm --versions ALIAS/BUCKET/OBJECT to delete an object and all its versions.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

64 - mc alias import

Syntax

The mc alias import command imports an alias configuration from a JSON document.

You can use mc alias export to create the necessary JSON for import.

The following command imports an alias configuration from a JSON document:

mc alias import newalias ./credentials.json

Use mc alias list newalias to confirm the import succeeded.

The mc alias import command has the following syntax:

mc [GLOBALFLAGS] alias import ALIAS PATH|STDIN
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The name of the alias to assign to the imported configuration.

PATH

mc-cmd

Required

The full path to the JSON object representing the alias configuration to import.

Mutually exclusive with the STDIN parameter.

STDIN

mc-cmd

Required

Directs the command to use the Standard Input (STDIN) as the source of the JSON object for import.

Mutually exclusive with the PATH parameter.

Global Flags

This command supports any of the global flags.

Behavior

JSON Format

The JSON object must have the following format:

{
   "url" : "https://hostname:port",
   "accessKey": "<STRING>",
   "secretKey": "<STRING>",
   "api": "s3v4",
   "path": "auto"
}

You can use the mc alias export command to export an existing alias from the local host configuration. Alternatively, you can manually extract the necessary JSOn fields from the mc configuration file.

Examples

Import an Alias Using Standard Input

The following example imports a custom alias for the play.min.io sandbox. You can modify this example to use user credentials you have already created or validated as existing on the sandbox:

echo '
{
 "url": "https://play.min.io",
 "accessKey": "minioadmin",
 "secretKey": "minioadmin",
 "api": "s3v4",
 "path": "auto"
}' | mc alias import play-minioadmin

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

65 - mc anonymous links

Syntax

The mc anonymous links retrieves the HTTP URL for anonymous (i.e. unauthenticated or public) access to a bucket.

Buckets with anonymous policies allow clients to access the bucket contents and perform actions consistent with the specified policy without authentication.

The following command retrieves HTTP URLs for the mydata bucket on the myminio MinIO deployment:

mc anonymous links --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] policy links   \
                 [--recursive]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The full path to the bucket or bucket prefix for which the command retrieves the anonymous bucket policies.

Specify the alias of the MinIO or other S3-compatible service and the full path to the bucket or bucket prefix. For example:

mc anonymous links public [FLAGS] play/mybucket
--recursive

mc-cmd

Optional Retrieve the HTTP links recursively.

Global Flags

This command supports any of the global flags.

Examples

List Anonymous Policies for Bucket

Use mc anonymous links to links the anonymous policies for a bucket:

mc anonymous links ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

66 - mc batch

Note

Added: mc

RELEASE.2023-03-20T17-17-53Z

Added the ability to cancel jobs with the mc batch cancel command.

Description

The mc batch commands allow you to run one or more job tasks on a MinIO deployment.

Subcommands

mc batch includes the following subcommands:

Subcommand

Description

cancel

The mc batch cancel stops an ongoing batch job.

describe

The mc batch describe command outputs the job definition for a specified job ID.

generate

The mc batch generate command creates a basic YAML-formatted template file for the specified job type.

list

The mc batch list command outputs a list of the batch jobs currently in progress on a deployment.

start

The mc batch start command launches a batch job from a job batch YAML file.

status

The mc batch status command outputs summaries of job events on a MinIO server.

67 - mc batch list

Note

Changed: MinIO

RELEASE.2022-10-09T21-10-59Z or later

Syntax

The mc batch list command outputs a list of the batch jobs currently in progress on a deployment.

The following command outputs a list of all jobs currently in progress on the myminio alias.

mc batch list myminio

The command has the following syntax:

mc [GLOBALFLAGS] batch list TARGET           \
                            --type "string"
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The alias of the deployment for which you want to list jobs in progress.

--type

mc-cmd

Optional

List batch jobs only of a certain type.

Global Flags

This command supports any of the global flags.

Example

List all replicate type batch jobs

The following command lists the replicate type job(s) on the deployment at alias myminio:

mc batch list myminio --type "replicate"
  • Replace myminio with the alias of the MinIO deployment that should run the job.

  • Replace replicate with the job type to output.

    Currently, mc batch only supports the replicate job type.

The output of the above command is similar to the following:

ID                      TYPE            USER            STARTED
E24HH4nNMcgY5taynaPfxu  replicate       minioadmin      1 minute ago

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Permissions

You must have the admin:ListBatchJobs permission to list jobs on the deployment.

68 - mc idp ldap accesskey info

Description

The mc idp ldap accesskey info outputs information about the specified access key(s).

This command works against access keys created by an AD/LDAP user after authenticating to MinIO.

Create AD/LDAP service accounts with the mc idp ldap accesskey create command.

MinIO supports using AssumeRoleWithLDAPIdentity to generate temporary access keys using the Security Token Service.

The following example outputs details for the access key mykey from the minio deployment:

mc idp ldap accesskey info minio/ mykey

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey info      \
                                    ALIAS     \
                                    KEY       \
                                    [KEY2] ...
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Replace KEY with the access key to delete. You can list more than one access key by separating each key with a space.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey ls minio
KEY

mc-cmd

Required

The configured access key to output information about.

You can list more than one access key by separating each key with a space.

Example

Output information about the access keys mykey and mykey2 from the minio deployment.

mc idp ldap accesskey info minio/ mykey mykey2

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

69 - mc idp ldap info

Description

The mc idp ldap info command outputs the current configuration for an AD/LDAP provider on a specified MinIO deployment.

The following example outputs the AD/LDAP configuration settings on the myminio deployment.

mc idp ldap info     \
            myminio

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap info   \
                          ALIAS
  • Replace ALIAS with the alias of a MinIO deployment to retrieve info on the AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment for which to output the current AD/LDAP configuration.

For example:

mc idp ldap info myminio

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

70 - mc ilm rule import

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm rule import replaces mc ilm import.

Syntax

The mc ilm rule import command imports an object lifecycle management configuration and applies it to a MinIO bucket.

The mc ilm rule import command imports from STDIN by default. You can input the contents from a .json file, such as one produced by mc ilm rule export.

The following command imports the lifecycle management configuration from mydata-lifecycle-config.json and applies it to the mydata bucket on the myminio deployment:

mc ilm rule import myminio/mydata < mydata-lifecycle-config.json

The command has the following syntax:

mc [GLOBALFLAGS] ilm rule import ALIAS < STDIN
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias and full path to the bucket on the MinIO deployment into which to import object lifecycle management rules. For example:

mc ilm rule import myminio/mydata < bucket-lifecycle.json

Global Flags

This command supports any of the global flags.

Examples

Import the Bucket Lifecycle Management Configuration

The following command imports the bucket lifecycle management configuration from the bucket-lifecycle.json file:

mc ilm rule import myminio/mybucket < bucket-lifecycle.json
mc ilm rule import ALIAS < file.json
  • Replace ALIAS with the alias of the MinIO deployment and the bucket into which to import object lifecycle management rules:

    myminio/mydata

  • Replace file.json with the name of the file from which to import the lifecycle management rules.

Required Permissions

For permissions required to import rules, refer to the required permissions on the parent command.

Behavior

Importing Configuration Overrides Existing Rules

mc ilm rule import replaces the current bucket lifecycle management rules with those defined in the imported JSON configuration.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

71 - mc ilm tier ls

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm tier ls replaces mc admin tier ls.

Description

The mc ilm tier ls command shows the remote tiers configured on a deployment.

The mc ilm tier list command has equivalent functionality to mc ilm tier ls.

Syntax

The command has the following syntax:

The following example outputs a list of the existing remote tiers on the myminio deployment.

 mc ilm tier ls myminio

The command has the following syntax:

mc ilm tier ls TARGET TIER_NAME

Parameters

The command accepts the following argument:

TARGET

mc-cmd

Required

The alias of a configured MinIO deployment on which the desired tier exists.

Global Flags

This command supports any of the global flags.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Permissions

For permissions required for reviewing a tier, refer to the required permissions on the parent command.

72 - mc replicate update

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc replicate update replaces the mc admin bucket remote update command.

Note

Changed: RELEASE.2022-11-07T23-47-39Z

mc replicate update replaces the mc replicate edit command.

Syntax

The mc replicate update command modifies an existing bucket replication rule.

mc [GLOBALFLAGS] replicate update FLAGS [FLAGS] ARGUMENTS [ARGUMENTS]

The following command modifies an existing replication rule for the mydata bucket on the myminio MinIO deployment:

mc replicate update --id "c76um9h4b0t1ijr36mug"           \
   --replicate "delete,delete-marker,existing-objects"  \
   myminio/mydata

The new replication configuration synchronizes all versioned delete operations, delete marker creation, and existing objects to the remote MinIO deployment.

The command has the following syntax:

mc [GLOBALFLAGS] replicate update              \
                 --remote-bucket string          \
                 [--bandwidth "string"]            \
                 [--healthcheck-seconds integer]   \
                 [--id "string"]                   \
                 [--limit-upload "string"]         \
                 [--limit-download "string"]       \
                 [--path "string"]                 \
                 [--priority int]                  \
                 [--proxy]
                 [--replicate "string"]            \
                 [--state string]
                 [--storage-class "string"]        \
                 [--sync string]                          \
                 [--tags "string"]                 \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment and full path to the bucket or bucket prefix on which to modify the replication rule. For example:

mc replicate update --id "c75nrap4b0talo3ipthg" [FLAGS]
--id

mc-cmd

Required

Specify the unique ID for a configured replication rule. Use the mc replicate ls command to list the replication rules for a bucket.

--bandwidth

mc-cmd

Optional

Limit bandwidth rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit bandwidth rates to no more than 1 GiB/s, use the following:

--limit-upload 1Gi

If not specified, MinIO does not limit the bandwidth rate.

--healthcheck-seconds

mc-cmd

Optional

The length of time in seconds between checks on the health of the remote bucket.

If not specified, MinIO uses an interval of 60 seconds.

--limit-download

mc-cmd

Optional

Limit download rates to no more than a specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit download rates to no more than 1 GiB/s, use the following:

--limit-download 1G

If not specified, MinIO uses an unlimited download rate.

--limit-upload

mc-cmd

Optional

Limit upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following:

--limit-upload 1G

If not specified, MinIO uses an unlimited upload rate.

--path

mc-cmd

Optional

Enable path-style lookup support for the remote bucket.

Valid values include:

  • on - use a path lookup to find the remote bucket
  • off - use a resource locator style (such as a domain or IP address) lookup to find the remote bucket
  • auto - ask MinIO to identify the correct type of lookup to use to find the remote bucket

When not defined, MinIO uses the auto value.

--priority

mc-cmd

Optional

Specify the integer priority of the replication rule. The value must be unique among all other rules on the source bucket. Higher values imply a higher priority than all other rules.

--proxy

mc-cmd

Optional

When defining active-active replication between buckets, do not proxy.

Valid values include:

  • enable - Enable proxying in active-active replication.
  • disable - Disable proxying in active-active replication.

By default, MinIO defaults to enable.

--remote-bucket

mc-cmd

Optional

Specify the credentials, destination deployment, and bucket of the remote location. Value may be an alias and bucket, location based (IP or URL), or path based.

For example, a URL based target might look like the following:

--remote-bucket https://user:[email protected]:9001/bucket

An alias based target might look like the following:

--remote-bucket minio-target/my-bucket
--replicate

mc-cmd

Optional

Specify a comma-separated list of the following values to enable extended replication features:

  • delete - Directs MinIO to replicate DELETE operations to the destination bucket.

  • delete-marker - Directs MinIO to replicate delete markers to the destination bucket.

  • replica-metadata-sync - Directs MinIO to synchronize metadata-only changes on a replicated object back to the source. This feature only effects two-way active-active replication configurations.

    Omitting this value directs MinIO to stop replicating metadata-only changes back to the source.

  • existing-objects - Directs MinIO to replicate objects created prior to configuring or enabling replication. MinIO by default does not synchronize existing objects to the remote target.

    See Replication of Existing Objects for more information.

--state

mc-cmd

Optional

Enables or disables the replication rule. Specify one of the following values:

  • "enable" - Enables the replication rule.
  • "disable" - Disables the replication rule.

Objects created while replication is disabled are not immediately eligible for replication after enabling the rule. You must explicitly enable replication of existing objects by including "existing-objects" to the list of replication features specified to mc replicate update --replicate.

See Replication of Existing Objects for more information.

--storage-class

mc-cmd

Optional

Specify the MinIO storage class to apply to replicated objects.

--sync

mc-cmd

Optional

Enable synchronous replication for this remote target.

By default, MinIO uses asynchronous replication.

--tags

mc-cmd

Optional

Specify one or more ampersand & separated key-value pair tags which MinIO uses for filtering objects to replicate. For example:

mc replicate update --id "ID" --tags "TAG1=VALUE&TAG2=VALUE&TAG3=VALUE"

MinIO applies the replication rule to any object whose tag set contains the specified replication tags.

Global Flags

This command supports any of the global flags.

Examples

Modify an Existing Replication Rule

Use mc replicate update to modify an existing replication rule.

mc replicate update ALIAS/PATH \
   --id ID                     \
   [--FLAGS]
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix on which the rule exists.
  • Replace ID with the unique identifier for the rule to modify. Use mc replicate ls to retrieve the list of replication rules on the bucket and their corresponding identifiers.
Note

Note

Modifying a replication configuration rule does not affect already replicated objects. For example, modifying the --tags filter does not result in the removal of replicated objects which do not meet the filter.

Update the Credentials for an Existing Replication Rule

Use mc replicate update to modify an existing replication rule.

mc replicate update ALIAS/PATH \
   --id ID                     \
   --remote-bucket https://user:[email protected]:9001/mybucket
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix on which the rule exists.
  • Replace ID with the updated credentials, path, and bucket.

Disable or Enable an Existing Replication Rule

Use mc replicate update with the --state flag to disable or enable a replication rule.

mc replicate update ALIAS/PATH \
   --id ID \
   --state "disable"|"enable"
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix on which the rule exists.
  • Replace ID with the unique identifier for the rule to modify. Use mc replicate ls to retrieve the list of replication rules on the bucket and their corresponding identifiers.
  • Specify either "disable" or "enable" to the --state flag to disable or enable the replication rule.
Note

Note

MinIO requires enabling existing object replication to synchronize objects written or removed after disabling a replication rule.

For rules without existing object replication, MinIO synchronizes only those write or delete operations issued while the replication rule is enabled.

Behavior

Required Permissions

MinIO strongly recommends creating users specifically for supporting bucket replication operations. See mc admin user and mc admin policy for more complete documentation on adding users and policies to a MinIO deployment.

The following policy provides permissions for configuring and enabling replication on a deployment.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "admin:SetBucketTarget",
                "admin:GetBucketTarget",
                "admin:ListBatchJobs",
                "admin:DescribeBatchJob",
                "admin:StartBatchJob",
                "admin:CancelBatchJob"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteBucketConfiguration"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetReplicationConfiguration",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:GetBucketLocation",
                "s3:GetBucketVersioning",
                "s3:GetObjectRetention",
                "s3:GetObjectLegalHold",
                "s3:PutReplicationConfiguration"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ],
            "Sid": "EnableReplicationRuleConfiguration"
        }
    ]
}
  • The "EnableRemoteBucketConfiguration" statement grants permission for creating a remote target for supporting replication.
  • The "EnableReplicationRuleConfiguration" statement grants permission for creating replication rules on a bucket. The "arn:aws:s3:::* resource applies the replication permissions to any bucket on the source deployment. You can restrict the user policy to specific buckets as-needed.

Use the mc admin policy create to add this policy to each deployment acting as a replication source. Use mc admin user add to create a user on the deployment and mc admin policy attach to associate the policy to that new user.

The following policy provides permissions for enabling synchronization of replicated data into the deployment.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetReplicationConfiguration",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:GetBucketLocation",
                "s3:GetBucketVersioning",
                "s3:GetBucketObjectLockConfiguration",
                "s3:GetEncryptionConfiguration"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ],
            "Sid": "EnableReplicationOnBucket"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetReplicationConfiguration",
                "s3:ReplicateTags",
                "s3:AbortMultipartUpload",
                "s3:GetObject",
                "s3:GetObjectVersion",
                "s3:GetObjectVersionTagging",
                "s3:PutObject",
                "s3:PutObjectRetention",
                "s3:PutBucketObjectLockConfiguration",
                "s3:PutObjectLegalHold",
                "s3:DeleteObject",
                "s3:ReplicateObject",
                "s3:ReplicateDelete"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ],
            "Sid": "EnableReplicatingDataIntoBucket"
        }
    ]
}
  • The "EnableReplicationOnBucket" statement grants permission for a remote target to retrieve bucket-level configuration for supporting replication operations on all buckets in the MinIO deployment. To restrict the policy to specific buckets, specify those buckets as an element in the Resource array similar to "arn:aws:s3:::bucketName".
  • The "EnableReplicatingDataIntoBucket" statement grants permission for a remote target to synchronize data into any bucket in the MinIO deployment. To restrict the policy to specific buckets, specify those buckets as an element in the Resource array similar to "arn:aws:s3:::bucketName/*".

Use the mc admin policy create to add this policy to each deployment acting as a replication target. Use mc admin user add to create a user on the deployment and mc admin policy attach to associate the policy to that new user.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

73 - mc support perf

Note

Changed: RELEASE.2022-07-24T02-25-13Z

mc support perf replaces the mc admin speedtest command.

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Description

Use the mc support perf command to review the performance of the S3 API (read/write), network IO, and storage (drive read/write).

The resulting tests can provide general guidance of deployment performance under S3 GET and PUT requests and identify any potential bottlenecks. For more complete performance testing, consider using a combination of load-testing using your staging application environments and the MinIO WARP S3 benchmarking tool.

mc support perf has the following subcommands

  1. drive

    Measure the speed of drives in a MinIO deployment.

    mc support perf drive temporarily suspends S3 API calls during the test. Incoming requests are held in a queue while the command runs. When the command completes or ends, MinIO processes the queued requests and resumes normal operations.

  2. object

    Measure the speed of reading and writing objects in a cluster.

  3. net

    Measure the network throughput of all nodes.

    mc support perf net temporarily suspends S3 API calls during the test. Incoming requests are held in a queue while the command runs. When the command completes or ends, MinIO processes the queued requests and resumes normal operations.

  4. client

    Measure the network throughput to a client.

  5. site-replication

    Measure the speed of site replication operations.

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Examples

Measure Speed of an Object

Measure the performance of S3 read/write of an object on the alias minio1. MinIO autotunes concurrency to obtain maximum throughput and IOPS (Input/Output Per Second).

mc support perf object minio1

Measure Speed of an Object of a Specific Size for a Specific Duration

Run object the S3 read/write performance of an object for 20 seconds with object size of 128MiB on alias minio1. MinIO autotunes concurrency to obtain maximum throughput.

mc support perf object minio1 --duration 20s --size 128MiB

Test Speed of All Drives on All Nodes with Default Specifications

Run drive read/write performance measurements on all drive on all nodes for a cluster with alias minio1. The command does not specify the blocksize, so the default of 4MiB is used.

mc support perf drive minio1

Test Drive Speed Measurements with Custom Specifications

Run drive read/write performance measurements on a cluster with alias minio1 specifying a blocksize of 64KiB and data read/written from each drive of 2GiB.

mc support perf drive minio1 --blocksize 64KiB --filesize 2GiB

Test Network Throughput

Run a network throughput test on a cluster with alias minio1.

mc support perf net minio1

Test Site Replication Speed

Run a test on the speed of site replication operations from the minio1 site to other configured peers.

mc support perf site-replication minio1

Syntax

mc support perf drive

mc-cmd

Measure the read/write speed of the drives in a cluster.

mc [GLOBAL FLAGS] support perf drive   \
                [--concurrent]         \
                [--verbose, -v]        \
                [--filesize]           \
                [--blocksize]          \
                [--serial]             \
                [--airgap]             \
                ALIAS

mc support perf object

mc-cmd

Measure the S3 performance of reading and writing objects in a cluster.

mc [GLOBAL FLAGS] support perf object  \
                [--size]               \
                [--concurrent]         \
                [--verbose, -v]        \
                [--airgap]             \
                ALIAS

mc support perf net

mc-cmd

Measure the network throughput of all nodes in a cluster.

mc [GLOBAL FLAGS] support perf net  \
                [--concurrent]      \
                [--verbose, -v]     \
                [--serial]          \
                [--airgap]          \
                ALIAS

mc support perf client

mc-cmd

Measure the network throughput from the local device running the MinIO Client to the server.

mc [GLOBAL FLAGS] support perf client  \
                --duration             \
                [--verbose, -v]        \
                [--airgap]             \
                ALIAS

mc support perf site-replication

mc-cmd

Measure the speed of site replication operations from the specified ALIAS to other configured peers.

mc [GLOBAL FLAGS] support perf site-replication \
                  --duration                    \
                  [--verbose, -v]               \
                  ALIAS

Parameters

--airgap

mc-cmd

Optional

Use in environments without network access to SUBNET (for example, airgapped, firewalled, or similar configuration).

If the deployment is airgapped, but the local device where you are using the minio client has network access, you do not need to use the --airgap flag.

--size

mc-cmd

Optional

Applies to the object command.

Specify the size of the object to use for upload and download performance test.

If not specified, the default value is 64MiB.

Use --size <value> where <value> is a number and the storage unit, KiB, MiB, or GiB.

--concurrent

mc-cmd

Optional

Applies to the drive, object, and net commands.

Specify the number of concurrent requests to test per server.

If not specified, the default value is 32.

Use --concurrent <value> where <value> is a number.

--verbose, -v

mc-cmd

Optional

Applies to the drive, object, and net commands.

Show per-server stats in the output.

--filesize

mc-cmd

Optional

Applies to the drive command.

Specify the total size of data to read or write to each drive.

If not specified, the default value is 1GiB.

Use --filesize <value> where <value> is a number and storage unit, KiB, MiB, or GiB.

--blocksize

mc-cmd

Optional

Applies to the drive command.

Specify the read/write block size.

If not specified, the default value is 4MiB.

Use --filesize <value> where <value> is a number and a storage unit, using standard storage unit abbreviations.

--serial

mc-cmd

Optional

Applies to the drive and net commands.

Run performance tests on drive(s) one by one.

ALIAS

mc-cmd

Required

Applies to the drive, object, net, and client commands.

The alias of the MinIO deployment.

--duration

mc-cmd

Required

Applies to the client command.

Length of time in seconds to perform the test. Time cannot be 0 or negative.

Global Flags

This command supports any of the global flags.

74 - mc support top net

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

The mc support top net command displays realtime network metrics.

The following command displays the current realtime network metrics for the alias myminio deployment.

mc support top net myminio/

The output returns information such as the server URL, network interface, receive rate, transmit rate, and system messages.

The command has the following syntax:

mc [GLOBALFLAGS] support top disk                \
                             [--interval value]  \
                             TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--interval

mc-cmd

Optional

The interval in seconds between metric requests.

By default, the command requests metrics every second.

Global Flags

This command supports any of the global flags.

75 - mc alias export

Note

Added: mc.RELEASE.2023-11-15T22-45-58Z

Syntax

The mc alias export command exports an alias configuration from the existing configuration.

The command outputs the result to STDOUT where you can either capture the output as a file or perform further modifications to the output as necessary.

Use the mc alias import command to import the resulting JSON configuration.

The following command exports an alias configuration from the existing host and outputs it to a file:

mc alias export play > play.json

The command outputs the file to Standard Out (STDOUT). You can alternatively pipe the output to a utility of your choice for further operations.

The mc alias export command has the following syntax:

mc [GLOBALFLAGS] alias export ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The name of the alias to export.

Global Flags

This command supports any of the global flags.

Behavior

JSON Format

The command outputs a JSON object with the following schema:

{
   "url" : "https://hostname:port",
   "accessKey": "<STRING>",
   "secretKey": "<STRING>",
   "api": "s3v4",
   "path": "auto"
}

You can use the mc alias import to import the JSON document.

Examples

Export and Transform an Alias

The following example exports the alias for the play.min.io sandbox. It then transforms the configuration using the jq utility and creates a new alias from the modified configuration:

mc alias export play | jq '.accessKey = "minioadmin" | .secretKey = "minioadmin"' | mc alias import play-custom

Back Up An Alias Configuration

The following command exports an alias configuration to a JSON file. You can then back up that file using your preferred process.

mc alias export play > play-backup.json

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

76 - mc anonymous get-json

Syntax

The mc anonymous get-json command gets anonymous (i.e. unauthenticated or public) access policies for a bucket.

Buckets with anonymous policies allow clients to access the bucket contents and perform actions consistent with the specified policy without authentication.

The following command retrieves the JSON-formatted anonymous policy for the mydata bucket on the myminio MinIO deployment:

mc anonymous get-json myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] get-json ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The full path to the bucket or bucket prefix for which to get the anonymous bucket policy.

Specify the alias of the MinIO or other S3-compatible service and the full path to the bucket or bucket prefix. For example:

mc anonymous get-json public play/mybucket

Global Flags

This command supports any of the global flags.

Examples

Get Anonymous Policy for Bucket

Use mc anonymous get-json to get the anonymous policy for a bucket:

mc anonymous get-json ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

77 - mc batch start

Note

Changed: MinIO

RELEASE.2022-10-09T21-10-59Z or later

Syntax

The mc batch start command launches a batch job from a job batch YAML file.

The batch job runs to completion (or up to the number of retries specified in the file) one time. To run the batch job again after completion, you must start it again.

The following command creates a basic YAML file for a replicate job on the mybucket bucket of the myminio alias.

mc batch start myminio jobfile.yaml

The output of the above command is something similar to:

Successfully start 'replicate' job `B34HHqnNMcg1taynaPfxu` on '2022-10-24 17:19:06.296974771 -0700 PDT'

The command has the following syntax:

mc [GLOBALFLAGS] batch start    \
                       ALIAS   \
                       JOBFILE
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias on which to start the batch job.

For example:

mc batch start myminio replicate.yaml
JOBFILE

mc-cmd

Required

A YAML-defined batch job. The job may have as many tasks as desired; there is no predefined limit.

Global Flags

This command supports any of the global flags.

Example

Start a Batch Job

The following command starts the batch of job(s) defined in the file replication.yaml on the deployment at alias myminio:

mc batch start myminio ./replication.yaml
  • Replace myminio with the alias of the MinIO deployment that should run the job.
  • Replace ./replication.yaml with the yaml-formatted file that describes the batch job. Use the file path relative to your current location.

The output of the above command is similar to the following:

Successfully start 'replicate' job `E24HH4nNMcgY5taynaPfxu` on '2022-09-26 17:19:06.296974771 -0700 PDT'

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Permissions

You must have the admin:StartBatchJob permission on the deployment to start jobs.

78 - mc cat

Syntax

The mc cat command concatenates the contents of a file or object to another file or object. You can also use the command to display the contents of the specified file or object to STDOUT. cat has similar functionality to cat.

The following command concatenates the contents of an object on a MinIO deployment to STDOUT:

mc cat play/mybucket/myobject.txt

The mc cat command has the following syntax:

mc [GLOBALFLAGS] cat                       \
                 ALIAS [ALIAS ...]         \
                 [--enc-c "value"]         \
                 [--offset "int"]          \
                 [--part-number "int"]     \
                 [--rewind]                \
                 [--tail "int"]            \
                 [--version-id "string"]   \
                 [--zip]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

You can also use mc cat against a local filesystem to produce similar results to the cat commandline tool.

Parameters

ALIAS

mc-cmd

Required

The alias of a MinIO deployment and the full path to the object. For example:

mc cat myminio/mybucket/myobject.txt

You can specify multiple objects on the same or different MinIO deployment. For example:

mc cat myminio/mybucket/object.txt myminio/myotherbucket/object.txt

For an object on a local filesystem, specify the full path to that object. For example:

mc cat ~/data/object.txt
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--offset

mc-cmd

Optional

Specify an integer that is the number of bytes from which the command offsets the output.

Mutually exclusive with the --part-number flag.

--part-number

mc-cmd

Optional

Download a specific part number of a multi-part upload. Specify the integer of the part number to download.

Mutually exclusive with the --offset and --tail flags.

--rewind

mc-cmd

Optional

Directs mc cat to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--tail

mc-cmd

Optional

Specify an integer that is the number of bytes from which the command trims the output.

Mutually exclusive with the --part-number flag.

--version-id, vid

mc-cmd

Optional

Directs mc cat to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--zip

mc-cmd

Optional

Extracts the contents from a zip file on the source to the remote. Requires a MinIO deployment as the source ALIAS.

Global Flags

This command supports any of the global flags.

Examples

View an S3 Object

Use mc cat to return the object:

mc cat ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.

View an S3 Object at a Point-In-Time

Use mc cat --rewind to return the object at a specific point-in-time in the past:

mc cat ALIAS/PATH --rewind DURATION
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.
  • Replace DURATION with the point-in-time in the past at which the command returns the object. For example, specify 30d to return the version of the object 30 days prior to the current date.
Note

Requires Versioning

mc cat requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

View an S3 Object with Specific Version

Use mc cat --version-id to return a specific version of the object:

mc cat ALIAS/PATH --version-id VERSION
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.
  • Replace VERSION with the specific version of the object to return.
Note

Requires Versioning

mc cat requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

Download a particular part

Use mc cat --part-number to download a particular part of a multi-part upload:

mc cat ALIAS/PATH --part-number=#
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.
  • Replace # with the integer of the part number to download. For example, to download part 3 of at 16-part multi-part file, use --part-number=3.

You cannot use the --part-number flag if you are using either the --offset or the --tail flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

79 - mc idp ldap accesskey ls

Description

The mc idp ldap accesskey ls displays a list of LDAP access key pairs.

mc idp ldap accesskey ls is also known as mc idp ldap accesskey list.

This command works against access keys created by an AD/LDAP user after authenticating to MinIO.

Create AD/LDAP service accounts with the mc idp ldap accesskey create command.

MinIO supports using AssumeRoleWithLDAPIdentity to generate temporary access keys using the Security Token Service.

The following example returns a list of access keys associated with the authenticated user on the minio alias:

mc idp ldap accesskey ls minio/

If the authenticated user has the admin:ListUsers permission, the example command returns a list of all users and their associated access keys.

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey ls           \
                                 ALIAS           \
                                 [--all]         \
                                 [--self]        \
                                 [--svcacc-only] \
                                 [--temp-only]   \
                                 [--users-only]  \
                                 [DN] ...
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Replace DN with the string of a user’s distinguished name. You may list multiple distinguished names by separating each with a space.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey ls minio
--all

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-07-31T15-58-33Z

List all access keys for all LDAP users.

--self

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-07-31T15-58-33Z

List access keys for the currently authenticated user.

--svcacc-only

mc-cmd

Optional

Output only service account access keys.

Mutually exclusive with --temp-only.

--temp-only

mc-cmd

Optional

Output only temporary access keys.

Mutually exclusive with --svcacc-only.

--users-only

mc-cmd

Optional

Output only the user distinguished names.

Examples

List All Access Keys

To return a list of all access keys, you must first authenticate as the admin user. Once authenticated, the following command returns all AD/LDAP access keys on the minio deployment.

mc idp ldap accesskey ls minio
Note

Note

If the user does not have the admin:ListUsers permission, the command returns a list of access keys for the authenticated user only.

List User Distinguished Names

To return a list of DNs for a deployment, you must first authenticate as a user with the admin:ListUsers permission. Once authenticated, the following command outputs the AD/LDAP distinguished names on the minio deployment.

mc idp ldap accesskey ls minio --users-only

List Temporary Access Keys

To return a list of all temporary access keys for a deployment, you must first authenticate as a user with the admin:ListUsers permission. Once authenticated, the following command outputs a list of distinguished names with their associated temporary access keys.

mc idp ldap accesskey ls minio --temp-only

List a User’s Access Keys

The following command returns the AD/LDAP access keys for the user bobfisher on the minio deployment.

mc idp ldap accesskey list minio/ uid=bobfisher,dc=min,dc=io

List Access Keys for Multiple Users

The following command returns the AD/LDAP access keys for the users bobfisher and cody3 on the minio deployment.

mc idp ldap accesskey list minio/ uid=bobfisher,dc=min,dc=io uid=cody3,dc=min,dc=io

List Access Keys for Authenticated User

The following command returns the AD/LDAP access keys for the currently authenticated user on the minio deployment.

mc idp ldap accesskey list minio/
Note

Note

If the authenticated user has the admin:ListUsers permission, the command returns a list of all users and access keys on the deployment.

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

80 - mc idp ldap ls

Description

The mc idp ldap ls command lists the existing set of configurations for an AD/LDAP provider.

mc idp ldap ls is also known as mc idp ldap list.

The following example lists the AD/LDAP configuration settings for the myminio deployment.

mc idp ldap ls       \
            myminio

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap ls     \
                          ALIAS
  • Replace ALIAS with the alias of a MinIO deployment to list the AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment for which to output the current AD/LDAP configuration.

For example:

mc idp ldap ls myminio

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

81 - mc ilm rule ls

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm rule ls replaces mc ilm ls.

Note

Changed: RELEASE.2023-05-26T23-31-54Z

mc ilm rule ls --json output includes the policy modification time in updateAt.

Syntax

The mc ilm rule ls command summarizes all configured object lifecycle management rules on a MinIO bucket in a tabular format.

The mc ilm rule list command has equivalent functionality to mc ilm rule ls.

The following command lists all lifecycle management rules for the mydata bucket on the myminio MinIO deployment:

mc ilm rule ls myminio/mydata

The output of the command might resemble the following:

┌───────────────────────────────────────────────────────────────────────────────┐
│ Transition for latest version (Transition)├────────┬─────────┬────────┬─────────────────────┬──────────────┬──────────────┤
│ ID     │ STATUS  │ PREFIX │ TAGS                │ DAYS TO TIER │ TIER         │
├────────┼─────────┼────────┼─────────────────────┼──────────────┼──────────────┤
│ rule-1 │ Enabled │ doc/   │ key1=val1&key2=val2 │            0 │ WARM-MINIO-1 │
└────────┴─────────┴────────┴─────────────────────┴──────────────┴──────────────┘
┌────────────────────────────────────────────────────────────────┐
│ Transition for older versions (NoncurrentVersionTransition)├────────┬─────────┬────────┬──────┬──────────────┬──────────────┤
│ ID     │ STATUS  │ PREFIX │ TAGS │ DAYS TO TIER │ TIER         │
├────────┼─────────┼────────┼──────┼──────────────┼──────────────┤
│ rule-2 │ Enabled │ logs/  │ -    │           10 │ WARM-MINIO-1 │
└────────┴─────────┴────────┴──────┴──────────────┴──────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ Expiration for latest version (Expiration)├────────┬─────────┬────────┬─────────────────────┬────────────────┬─────────────────────┤
│ ID     │ STATUS  │ PREFIX │ TAGS                │ DAYS TO EXPIRE │ EXPIRE DELETEMARKER │
├────────┼─────────┼────────┼─────────────────────┼────────────────┼─────────────────────┤
│ rule-1 │ Enabled │ doc/   │ key1=val1&key2=val2 │             30false└────────┴─────────┴────────┴─────────────────────┴────────────────┴─────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────┐
│ Expiration for older versions (NoncurrentVersionExpiration)├────────┬─────────┬────────┬─────────────────────┬────────────────┬───────────────┤
│ ID     │ STATUS  │ PREFIX │ TAGS                │ DAYS TO EXPIRE │ KEEP VERSIONS │
├────────┼─────────┼────────┼─────────────────────┼────────────────┼───────────────┤
│ rule-1 │ Enabled │ doc/   │ key1=val1&key2=val2 │             150│ rule-2 │ Enabled │ logs/  │ -                   │              13└────────┴─────────┴────────┴─────────────────────┴────────────────┴───────────────┘

The mc ilm rule ls command has the following syntax:

mc [GLOBALFLAGS] ilm rule ls     \
                 [--expiry]      \
                 [--transition]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias and full path to the bucket on the MinIO deployment for which to list the object lifecycle management rules. For example:

mc ilm rule ls myminio/mydata
--expiry

mc-cmd

Optional

mc ilm rule ls returns only fields related to lifecycle rule expiration.

Mutually exclusive with --transition.

--transition

mc-cmd

Optional

mc ilm rule ls returns only fields related to lifecycle rule transition.

Mutually exclusive with --expiry.

Global Flags

This command supports any of the global flags.

Examples

List Bucket Lifecycle Management Rules

Use mc ilm rule ls to list a bucket’s lifecycle management rules:

mc ilm rule ls ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket on the S3-compatible host.

Show Policy Modification Time

Use mc ilm rule ls with :option::–json <mc.–json> to show the time the policy for a bucket was last updated.

mc ilm rule ls ALIAS/PATH --json
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket on the S3-compatible host.

The updateAt property in the JSON output contains the date and time the policy was updated.

The output resembles the following:

{
 "status": "success",
 "target": "myminio/mybucket",
 "config": {
  "Rules": [
   {
    "Expiration": {
     "Days": 30
    },
    "ID": "ci1o2mg0sko6f1r3krv0",
    "Status": "Enabled"
   }
  ]
 },
 "updatedAt": "2023-06-09T19:45:30Z"
}

Required Permissions

For permissions required to list rules, refer to the required permissions on the parent command.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

82 - mc ilm tier rm

Description

The mc ilm tier rm command removes an remote tier that has not been used to transition any objects.

The mc ilm tier remove command has equivalent functionality to mc ilm tier rm

Note

Note

Once a tier has transitioned objects, it cannot be removed.

Required Permissions

MinIO requires the following permissions scoped to the bucket or buckets for which you are creating lifecycle management rules.

MinIO also requires the following administrative permissions on the cluster in which you are creating remote tiers for object transition lifecycle management rules:

For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:.

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "admin:SetTier",
               "admin:ListTier"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteTierManagement"
      },
      {
            "Action": [
               "s3:PutLifecycleConfiguration",
               "s3:GetLifecycleConfiguration"
            ],
            "Resource": [
                        "arn:aws:s3:::*"
            ],
            "Effect": "Allow",
            "Sid": "EnableLifecycleManagementRules"
      }
   ]
}

Syntax

The command has the following syntax:

The following example removes an existing remote tier called WARM-TIER on the myminio deployment. No objects have transitioned to the WARM-TIER tier.

 mc ilm tier rm myminio WARM-TIER

The command has the following syntax:

mc ilm tier info TARGET TIER_NAME

Parameters

The command accepts the following arguments:

TARGET

mc-cmd

Required

The alias of a configured MinIO deployment on which the desired tier exists.

TIER_NAME

mc-cmd

Required

The name of an existing remote tier to remove.

You must specify the tier in all-caps, e.g. WARM_TIER.

No object can have transitioned to the tier.

Global Flags

This command supports any of the global flags.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Permissions

For permissions required to remove a tier, refer to the required permissions on the parent command.

83 - mc replicate resync

Syntax

The mc replicate resync command resynchronizes all objects in the specified MinIO bucket to a remote replication target.

This command requires first configuring the remote bucket target using the mc replicate add command. You must specify the resulting remote ARN as part of running mc replicate resync.

This command supports rebuilding a MinIO deployment using an active-active replication remote as the “backup” source. See the following tutorials for more information on active-active replication:

The following command resynchronizes the content of the mydata bucket on the myminio MinIO deployment to the remote MinIO deployment associated to the specified --remote-bucket:

mc replicate resync start \
   --remote-bucket "arn:minio:replication::d3c086c7-1d64-40c2-954b-fe8222907033:mydata" \
   myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] replicate resync start|status  \
                 --remote-bucket "string"       \
                 [--older-than "string"]        \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment and full path to the bucket or bucket prefix which MinIO uses as the replication source. For example, the following command starts replication using the data bucket on the MinIO deployment associated to the primary alias.

mc replicate resync start primary/data --remote-bucket "ARN"
start

mc-cmd

Required

Starts the resynchronization procedure using the specified bucket as the source and the --remote-bucket as the remote target.

Mutually exclusive with mc replicate resync status.

status

mc-cmd

Required

Returns the status of resynchronization on the specified bucket to all remote targets.

Include the --remote-bucket argument to filter the status output to only the specified remote target.

--remote-bucket

mc-cmd

Required

Specify the ARN for the destination deployment and bucket.

You can retrieve the ARN using mc replicate ls with the --json option. The rule.Destination.Bucket field contains the ARN for any given replication rule.

older-than

mc-cmd

Optional

Specify a duration in days where MinIO only resynchronizes objects older than the specified duration.

Only valid with mc replicate resync start.

Global Flags

This command supports any of the global flags.

Examples

Resynchronize Remote Replication Target from Source Bucket

The following mc replicate resync command resynchronizes all objects on the specified source bucket to the remote target regardless of their replication status:

mc replicate resync start --remote-bucket "arn:minio:replication::UUID:data" primary/data
  • Replace primary/data with the ALIAS and full bucket path for which to create the replication configuration.
  • Replace the --remote-bucket value with the ARN of the remote target. Use mc replicate ls to list all configured remote replication targets.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

84 - mc support profile

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Description

mc support profile runs a system profile for your deployment. The results of the profile can provide insight into the MinIO server process running on a given node.

The resulting report is intended for use by MinIO Engineering. You can upload the report to MinIO SUBNET. Independent or third-party use of these profiles for diagnostics and remediation is done at your own risk.

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Examples

Fetch CPU Profiling

This command retrieves the CPU profile on a MinIO deployment with the alias minio1. The profile runs for the default of 10 seconds.

mc support profile --type cpu minio1/

Fetch CPU, Memory, and Block Profiling Concurrently

This command fetches the profile of the CPU, memory, and block usage on the alias minio2. The profile runs for the default of 10 seconds.

mc support profile --type cpu,mem,block minio2/

Fetch CPU, Memory, and Block Profiling Concurrently for 10 Minutes

This command fetches the profile of the CPU, memory, and block on the alias minio3. The profile runs for 10 minutes (600 seconds).

mc support profile --type cpu,mem,block --duration 600 minio3/

Syntax

The mc support profile command has the following syntax:

mc [GLOBALFLAGS] support profile       \
                         COMMAND       \
                         [--type]      \
                         [--airgap]    \
                         [--duration]  \
                         ALIAS

Parameters

--duration

mc-cmd

Optional

Run profiling for the specified duration in seconds.

Use --type <value> where <value> is the number of seconds for the profile to run.

If not specified, the command collects data for 10 seconds.

--type

mc-cmd

Optional

Specify the profile(s) to gather data for.

Use --type <value> where <value> is one or more comma-separated types of data to collect.

Valid types are:

  • cpu
  • cpuio
  • mem
  • block
  • mutex
  • trace
  • threads
  • goroutines

If not specified, the command collects data for CPU, memory, block, mutex, threads, and goroutines.

Warning

Important

Do not use the cpuio or trace data types unless directed to by MinIO Support. These profiles require significant resources and may degrade cluster performance if used without guidance.

--airgap

mc-cmd

Optional

Use in environments without network access to SUBNET (for example, airgapped, firewalled, or similar configuration).

If the deployment is airgapped, but the local device where you are using the minio client has network access, you do not need to use the --airgap flag.

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

Global Flags

This command supports any of the global flags.

85 - mc support top rpc

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

The mc support top rpc command displays metrics for remote procedure calls (RPC).

The following command displays the current remote procedure call metrics for the alias myminio deployment.

mc support top rpc myminio/

The output returns information such as the server, number of connections, length of ping, time since last ping (pong), reconnections, string in, string out, messages in, and messages out.

The output resembles

λ mc support top rpc myminio
      SERVER            CONCTD  PING     PONG   OUT.Q   RECONNS STR.IN  STR.OUT MSG.IN  MSG.OUT
 To  127.0.0.1:9002       5     0.7ms   1s ago    0        0     ->0      0->    3269    3212
From 127.0.0.1:9002       5     1.1ms   1s ago    0        0     ->0      0->    3213    3269
 To  127.0.0.1:9003       5     0.6ms   1s ago    0        0     ->0      0->    6001    6076
From 127.0.0.1:9003       5     0.6ms   1s ago    0        0     ->0      0->    6077    6001
 To  127.0.0.1:9004       5     0.6ms   1s ago    0        0     ->0      0->    3243    3160
From 127.0.0.1:9004       5     0.4ms   1s ago    0        0     ->0      0->    3161    3243
 To  127.0.0.1:9005       5     0.6ms   1s ago    0        0     ->0      0->    3150    3094
From 127.0.0.1:9005       5     0.3ms   1s ago    0        0     ->0      0->    3095    3150
 To  127.0.0.1:9006       5     0.3ms   1s ago    0        0     ->0      0->    3185    3221
From 127.0.0.1:9006       5     0.6ms   1s ago    0        0     ->0      0->    3222    3185

The command has the following syntax:

mc [GLOBALFLAGS] support top rpc                 \
                             [--airgap]          \
                             [--in value]        \
                             [--interval value]  \
                             [-n value]          \
                             [--nodes value]     \
                             TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--airgap

mc-cmd

Optional

Use in environments without network access to SUBNET.

--in

mc-cmd

Optional

Replay a previously saved JSON file. Specify the path to the JSON file to replay, such as one generated by a previous run of this command.

--interval

mc-cmd

Optional

The interval in seconds between metric requests.

By default, the command requests metrics every second.

-n

mc-cmd

Optional

The number of requests to run before existing. Use 0 for endless.

If not specified, the command does not automatically exit.

--nodes

mc-cmd

Optional

Comma-separated list of the node or nodes from which to collect metrics.

Global Flags

This command supports any of the global flags.

86 - mc anonymous set-json

Syntax

The mc anonymous set-json command sets anonymous (that is, unauthenticated or public) access policies for a bucket using an IAM JSON policy document.

Buckets with anonymous policies allow clients to access the bucket contents and perform actions consistent with the specified policy without authentication.

The following command applies the JSON-formatted anonymous policy to the mydata bucket on the myminio MinIO deployment:

mc anonymous set-json ~/mydata-anonymous.json myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] set-json POLICY ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

POLICY

mc-cmd

Required The path to the JSON-formatted policy to assign to the specified ALIAS.

ALIAS

mc-cmd

Required The full path to the bucket or bucket prefix to which the command applies the specified POLICY.

Specify the alias of the MinIO or other S3-compatible service and the full path to the bucket or bucket prefix. For example:

mc anonymous set-json public play/mybucket

Global Flags

This command supports any of the global flags.

Examples

Set Anonymous Policy for Bucket

Use mc anonymous set-json to set the anonymous policy for a bucket:

mc anonymous set-json POLICY ALIAS/PATH
  • Replace POLICY with a supported POLICY.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Remove Anonymous Policy for Bucket

Use mc anonymous set to clear the anonymous policy for a bucket:

mc anonymous set none ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

87 - mc batch status

Note

Changed: MinIO

RELEASE.2022-10-09T21-10-59Z or later

Syntax

The mc batch status command outputs summaries of job events on a MinIO server.

Note

Changed: mc

RELEASE.2024-07-03T20-17-25Z

Batch status displays summaries for active, in-progress jobs or any batch job completed in the previous three (3) days.

The following command outputs the status of the specified job with JobID KwSysDpxcBU9FNhGkn2dCf currently in progress on the myminio alias.

mc batch status myminio "KwSysDpxcBU9FNhGkn2dCf"

The command has the following syntax:

mc [GLOBALFLAGS] batch list TARGET           \
                            ["JOBID"]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The alias for which to display batch job statuses.

JOBID

mc-cmd

Optional

The unique identifier of a job to summarize. To find the ID of a job, use mc batch list.

If not specified, the command returns a summary for the current active batch job.

Global Flags

This command supports any of the global flags.

Example

Summarize the Events of an Active Replicate Job

The following command provides the real-time summary of an active job on the deployment at alias myminio:

mc batch status myminio "KwSysDpxcBU9FNhGkn2dCf"
  • Replace myminio with the alias of the MinIO deployment that should run the job.

The output of the above command is similar to the following:

●∙∙
JobType:        replicate
Objects:        28766
Versions:       28766
FailedObjects:  0
Transferred:    406 MiB
Elapsed:        2m14.227222868s
CurrObjName:    share/doc/xml-core/examples/foo.xmlcatalogs

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

88 - mc cp

Syntax

The mc cp command copies objects to or from a MinIO deployment, where the source can MinIO or a local filesystem.

You can also use mc cp against the local filesystem to produce similar results to the cp commandline tool.

Note

Note

mc cp only copies the latest version or the specified version of an object without any version information or modification date. To copy all versions, version information, and related metadata, use mc replicate add or mc admin replicate.

The following command copies files from a local filesystem directory to the mydata bucket on the myminio MinIO deployment:

mc cp --recursive ~/mydata/ myminio/mydata/

The mc cp command has the following syntax:

mc [GLOBALFLAGS] cp                                                        \
                 [--attr "string"]                                         \
                 [--disable-multipart]                                     \
                 [--enc-kms "string"]                                      \
                 [--enc-s3 "string"]                                       \
                 [--enc-c "string"]                                        \
                 [--legal-hold "on"]                                       \
                 [--limit-download string]                                 \
                 [--limit-upload string]                                   \
                 [--md5]                                                   \
                 [--newer-than "string"]                                   \
                 [--older-than "string"]                                   \
                 [--preserve]                                              \
                 [--recursive]                                             \
                 [--retention-mode "string" --retention-duration "string"] \
                 [--rewind "string"]                                       \
                 [--storage-class "string"]                                \
                 [--tags "string"]                                         \
                 [--version-id "string"]                                   \
                 [--zip]                                                   \
                 SOURCE [SOURCE ...]                                       \
                 TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

SOURCE

mc-cmd

Required

The object or objects to copy.

For copying an object from MinIO, specify the alias and the full path to that object (e.g. bucket and path to object). For example:

mc cp play/mybucket/object.txt ~/mydata/object.txt

Specify multiple SOURCE paths to copy multiple objects to the specified TARGET. mc cp treats the last specified alias or filesystem path as the TARGET. For example:

mc cp ~/data/object.txt myminio/mydata/object.txt play/mydata/

For copying an object from a local filesystem, specify the full path to that object. For example:

mc cp ~/mydata/object.txt play/mybucket/object.txt

If you specify a directory or bucket to SOURCE, you must also specify --recursive to recursively copy the contents of that directory or bucket. If you omit the --recursive argument, cp only copies objects in the top level of the specified directory or bucket.

TARGET

mc-cmd

Required

The full path to which mc cp copies the object.

For copying an object to MinIO, specify the alias and the full path to that object (e.g. bucket and path to object). For example:

mc cp ~/mydata/object.txt play/mybucket/object.txt

For copying an object from a local filesystem, specify the full path to that object. For example:

mc cp play/mybucket/object.txt ~/mydata/object.txt
--attr

mc-cmd

Optional

Add custom metadata for the object. Specify key-value pairs as KEY=VALUE\;. For example, --attr key1=value1\;key2=value2\;key3=value3.

--checksum

mc-cmd

Optional

Note

Added: RELEASE.2024-10-02T08-27-28Z

Add a checksum to an uploaded object.

Valid values are: - MD5 - CRC32 - CRC32C - SHA1 - SHA256

The flag requires server trailing headers and works with AWS or MinIO targets.

--disable-multipart

mc-cmd

Optional

Disables multipart upload for the copy session.

--enc-kms

mc-cmd

Encrypt or decrypt objects using server-side SSE-KMS encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify an existing data key on the external KMS.

See the mc admin kms key create reference for creating data keys.

For example:

--enc-kms "myminio/mybucket/prefix/object.obj=mybucketencryptionkey"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-kms "myminio/mybucket/prefix/=mybucketencryptionkey"
--enc-s3

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-S3 encryption with KMS-managed keys. Specify the full path to the object as alias/bucket/prefix/object.

For example:

--enc-s3 "myminio/mybucket/prefix/object.obj"

You can specify the parameter multiple times to denote different object(s) to encrypt:

--enc-s3 "myminio/mybucket/foo/fooobject.obj" --enc-s3 "myminio/mybucket/bar/barobject.obj"

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-s3 "myminio/mybucket/foo"
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

mc-cmd

Optional

Enables indefinite legal hold object locking on the copied objects.

Specify on.

--limit-download

mc-cmd

Optional

Limit client-side download rates to no more than a specified rate in KiB/s, MiB/s, or GiB/s. This affects only the download to the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit download rates to no more than 1 GiB/s, use the following:

--limit-download 1G

If not specified, MinIO uses an unlimited download rate.

--limit-upload

mc-cmd

Optional

Limit client-side upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. This affects only the upload from the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following:

--limit-upload 1G

If not specified, MinIO uses an unlimited upload rate.

--md5

mc-cmd

Optional

Note

Changed: RELEASE.2024-10-02T08-27-28Z

Replaced by the --checksum flag.

Forces all uploads to calculate MD5 checksums.

--newer-than

mc-cmd

Optional

Copy object(s) newer than the specified number of days. Specify a string in #d#hh#mm#ss format. For example: --older-than 1d2hh3mm4ss

Defaults to 0 (all objects).

--older-than

mc-cmd

Optional

Copy object(s) older than the specified time limit. Specify a string in #d#hh#mm#ss format. For example: --older-than 1d2hh3mm4ss

Defaults to 0 (all objects).

--preserve, a

mc-cmd

Optional

Preserve file system attributes and bucket policy rules of the SOURCE directories, buckets, and objects on the TARGET bucket(s).

--recursive, r

mc-cmd

Optional

Recursively copy the contents of each bucket or directory SOURCE to the TARGET bucket.

--retention-duration

mc-cmd

Optional

The duration of the WORM retention mode to apply to the copied object(s).

Specify the duration as a string in #d#hh#mm#ss format. For example: --retention-duration "1d2hh3mm4ss".

Requires specifying --retention-mode.

--retention-mode

mc-cmd

Optional

Enables object locking mode on the copied object(s). Supports the following values:

  • GOVERNANCE
  • COMPLIANCE

Requires specifying --retention-duration.

--rewind

mc-cmd

Optional

Directs mc cp to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified SOURCE be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--storage-class, sc

mc-cmd

Optional

Set the storage class for the new object(s) on the TARGET.

See https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html for more information on S3 storage classes.

--tags

mc-cmd

Optional

Applies one or more tags to the copied objects.

Specify an ampersand-separated list of key-value pairs as KEY1=VALUE1&KEY2=VALUE2, where each pair represents one tag to assign to the objects.

--version-id, vid

mc-cmd

Optional

Directs mc cp to operate only on the specified object version.

--version-id requires that the specified SOURCE be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--zip

mc-cmd

Optional

During copy, extract files from a .zip archive. Only functional when the source archive file exists on a MinIO deployment.

Global Flags

This command supports any of the global flags.

Examples

Copy Object to S3

Use mc cp to copy an object to an S3-compatible host:

mc cp SOURCE ALIAS/PATH
  • Replace SOURCE with the filesystem path to the object.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host. You can specify a different object name to “rename” the object on copy.
mc cp SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace SRCALIAS with the alias of a source S3-compatible host.
  • Replace SRCPATH with the path to the object on the S3-compatible host.
  • Replace TGTALIAS with the alias of a target S3-compatible host.
  • Replace TGTPATH with the path to the object on a target S3-compatible host. Omit the object name to use the SRCPATH object name.

Recursively Copy Objects to S3

Use mc cp --recursive to recursively copy objects to an S3-compatible host:

mc cp --recursive SOURCE ALIAS/PATH
  • Replace SOURCE with the filesystem path to the directory containing the file(s).
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host. mc cp uses the SOURCE filenames when creating the objects on the target host.
mc cp --recursive SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace SRCALIAS with the alias of a source S3-compatible host.
  • Replace SRCPATH with the path to the bucket or bucket prefix on the source S3-compatible host.
  • Replace TGTALIAS with the alias of a target S3-compatible host.
  • Replace TGTPATH with the path to the object on the target S3-compatible host. mc cp uses the SRCPATH object names when creating objects on the target host.

Copy Point-In-Time Version of Object

Use mc cp --rewind to copy an object as it existed at a specific point in time. This command only applies to S3-to-S3 copy.

mc cp --rewind DURATION SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace DURATION with the point-in-time in the past at which the command copies the object. For example, specify 30d to copy the version of the object 30 days prior to the current date.
  • Replace SRCALIAS with the alias of a source S3-compatible host.
  • Replace SRCPATH with the path to the object on the source S3-compatible host.
  • Replace TGTALIAS with the alias of a target S3-compatible host.
  • Replace TGTPATH with the path to the object on the target S3-compatible host. Omit the object name to use the SRCPATH object name.
Note

Requires Versioning

mc cp requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

Copy Specific Version of Object

Use mc cp --version-id to copy a specific version of an object. This command only applies to S3-to-S3 copy.

mc cp --version-id VERSION SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace VERSION with the version of the object to copy.
  • Replace SRCALIAS with the alias of a source S3-compatible host.
  • Replace SRCPATH with the path to the object on the source S3-compatible host.
  • Replace TGTALIAS with the alias of a target S3-compatible host.
  • Replace TGTPATH with the path to the object on the target S3-compatible host. Omit the object name to use the SRCPATH object name.
Note

Requires Versioning

mc cp requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

Add a content-type Value

Use mc cp --attr to add a content-type value. This command only applies to S3-to-S3 copy.

mc cp --attr="content-type=CONTENT-TYPE" SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace CONTENT-TYPE with the desired content type (also called a media type).
  • Replace SRCALIAS with the alias of a source S3-compatible host.
  • Replace SRCPATH with the path to the object on the source S3-compatible host.
  • Replace TGTALIAS with the alias of a target S3-compatible host.
  • Replace TGTPATH with the path to the object on the target S3-compatible host. Omit the object name to use the SRCPATH object name.

The following example sets a content-type of application/json:

 mc cp data.ndjson --attr="content-type=application/json" myminio/mybucket

Behavior

mc cp verifies all copy operations to object storage using MD5SUM checksums.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

89 - mc idp ldap accesskey rm

Description

The mc idp ldap accesskey rm deletes the specified access key from the local server.

mc idp ldap accesskey rm is also known as mc idp ldap accesskey remove.

This command works against access keys created by an AD/LDAP user after authenticating to MinIO.

Create AD/LDAP service accounts with the mc idp ldap accesskey create command.

MinIO supports using AssumeRoleWithLDAPIdentity to generate temporary access keys using the Security Token Service.

The following example deletes the access key mykey from the minio deployment:

mc idp ldap accesskey rm minio/ mykey

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey rm              \
                                 ALIAS              \
                                 KEY
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Replace KEY with the access key to delete.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey ls minio
KEY

mc-cmd

Required

The configured access key to delete.

Example

Delete the access key mykey from the minio deployment.

mc idp ldap accesskey rm minio/ mykey

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

90 - mc idp ldap rm

Description

The mc idp ldap rm command removes the existing configuration for an AD/LDAP provider.

mc idp ldap rm is also known as mc idp ldap remove.

The following example removes the AD/LDAP provider settings for the myminio deployment.

mc idp ldap rm       \
            myminio

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap rm     \
                          ALIAS
  • Replace ALIAS with the alias of a MinIO deployment to remove the AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment for which to remove the current AD/LDAP configuration.

For example:

mc idp ldap rm myminio

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

91 - mc ilm rule rm

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm rule rm replaces mc ilm rm.

Syntax

The mc ilm rule rm command removes an object lifecycle management rule from a MinIO Bucket.

The following command removes a single lifecycle management rule from the mydata bucket on the myminio MinIO deployment:

mc ilm rule rm --id "bgrt1ghju" myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] ilm rule rm                         \
                     --id "string" | (--all --force) \
                     ALIAS                           \
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias and full path to the bucket on the MinIO deployment to which to remove the object lifecycle management rule. For example:

mc ilm rule rm myminio/mydata
--all

mc-cmd

Optional

Removes all rules in the bucket. Requires including --force.

Mutually exclusive with --id.

--force

mc-cmd

Optional

Required if specifying --all.

--id

mc-cmd

Optional

The unique ID of the rule. Use mc ilm rule ls to list bucket rules and retrieve the id for the rule you want to remove.

Mutually exclusive with mc ilm rule rm --all

Global Flags

This command supports any of the global flags.

Examples

Remove a Bucket Lifecycle Management Rule

Use mc ilm rule rm to remove a bucket lifecycle management rule:

mc ilm rule rm --id "RULE" ALIAS/PATH
  • Replace RULE with the unique identifier of the lifecycle management rule. Use mc ilm rule ls to find the ID to use.
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket on the S3-compatible host.

Required Permissions

For permissions required to remove a rule, refer to the required permissions on the parent command.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

92 - mc ilm tier update

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc ilm tier update replaces mc admin tier edit.

Description

The mc ilm tier update command modifies an existing configured remote tier.

Note

Use mc admin on MinIO Deployments Only

MinIO does not support using mc admin commands with other S3-compatible services, regardless of their claimed compatibility with MinIO deployments.

Supported S3 Services

mc ilm tier supports only the following S3-compatible services as a remote target for object tiering:

  • MinIO
  • Amazon S3
  • Google Cloud Storage
  • Azure Blob Storage

Required Permissions

MinIO requires the following permissions scoped to the bucket or buckets for which you are creating lifecycle management rules.

MinIO also requires the following administrative permissions on the cluster in which you are creating remote tiers for object transition lifecycle management rules:

For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:.

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "admin:SetTier",
               "admin:ListTier"
            ],
            "Effect": "Allow",
            "Sid": "EnableRemoteTierManagement"
      },
      {
            "Action": [
               "s3:PutLifecycleConfiguration",
               "s3:GetLifecycleConfiguration"
            ],
            "Resource": [
                        "arn:aws:s3:::*"
            ],
            "Effect": "Allow",
            "Sid": "EnableLifecycleManagementRules"
      }
   ]
}

Transition Permissions

Object transition lifecycle management rules require additional permissions on the remote storage tier. Specifically, MinIO requires the remote tier credentials provide read, write, list, and delete permissions.

For example, if the remote storage tier implements AWS IAM policy-based access control, the following policy provides the necessary permission for transitioning objects into and out of the remote tier:

{
   "Version": "2012-10-17",
   "Statement": [
      {
            "Action": [
               "s3:ListBucket"
            ],
            "Effect": "Allow",
            "Resource": [
               "arn:aws:s3:::MyDestinationBucket"
            ],
            "Sid": ""
      },
      {
            "Action": [
               "s3:GetObject",
               "s3:PutObject",
               "s3:DeleteObject"
            ],
            "Effect": "Allow",
            "Resource": [
               "arn:aws:s3:::MyDestinationBucket/*"
            ],
            "Sid": ""
      }
   ]
}

Modify the Resource for the bucket into which MinIO tiers objects.

Defer to the documentation for the supported tiering targets for more complete information on configuring users and permissions to support MinIO tiering:

Syntax

The following example updates the credentials for an existing remote tier called S3TIER on the myminio deployment.

 mc ilm tier update myminio S3TIER --access-key ACCESS_KEY --secret-key SECRET_KEY

After running this command, lifecycle management rules on the myminio deployment use the tier’s new credentials to transition objects into the remote location. Options not modified in the command maintain their existing configurations.

The command has the following syntax:

mc ilm tier update TARGET                         \
                   TIER_NAME                      \
                   [--account-key value]          \
                   [--access-key value]           \
                   [--az-sp-tenant-id value]      \
                   [--az-sp-client-id value]      \
                   [--az-sp-client-secret value]  \
                   [--secret-key value]           \
                   [--use-aws-role]               \
                   [--credentials-file value]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

The command accepts the following arguments:

TARGET

mc-cmd

Required

The alias of a configured MinIO deployment.

TIER_NAME

mc-cmd

Required

The name of the remote tier the command modifies. The value corresponds to the mc ilm tier add TIER_NAME specified when creating the remote tier.

--access-key

mc-cmd

Optional

The access key for a user on the remote S3 or MinIO tier. The user must have permission to perform read/write/list/delete operations on the remote bucket or bucket prefix.

This option only applies to remote storage tiers with TIER_TYPE is s3 or minio. This option has no effect for any other TIER_TYPE.

--secret-key

mc-cmd

Optional

The secret key for a user on the remote s3 or minio tier.

This option only applies to remote storage tiers with TIER_TYPE is s3 or minio. This option has no effect for any other TIER_TYPE.

--use-aws-role

mc-cmd

Optional

Use the access permission for the locally configured AWS Role.

This option only applies if TIER_TYPE is s3 or minio. This option has no effect for any other value of TIER_TYPE.

--account-key

mc-cmd

Optional

The account key for a user on a remote Azure tier.

Required for Azure tier types.

Use this option to rotate the credentials for the --account-name associated to the remote tier.

This option only applies to remote storage tiers with TIER_TYPE is azure. This option has no effect for any other type of login.

--az-sp-tenant-id

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-07-03T20-17-25Z

Directory ID for the Azure service principal account.

This option only applies to remote storage tiers with TIER_TYPE is azure. This option has no effect for any other type of login.

--az-sp-client-id

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-07-03T20-17-25Z

Client ID of the Azure service principal account.

Requires --az-sp-client-secret.

This option only applies to remote storage tiers with TIER_TYPE is azure. This option has no effect for any other type of login.

--az-sp-client-secret

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-07-03T20-17-25Z

The secret for the Azure service principal account.

Requires --az-sp-client-id.

This option only applies to remote storage tiers with TIER_TYPE is azure. This option has no effect for any other type of login.

--credentials-file

mc-cmd

Optional

Required for Google Cloud Storage tier types.

The credential file for a user on the remote GCS tier. The user must have permission to perform read/write/list/delete operations on the remote bucket or bucket prefix.

This option only applies to remote storage tiers with TIER_TYPE is gcs. This option has no effect for any other type of login.

Global Flags

This command supports any of the global flags.

Examples

Rotate Credentials for an S3 Remote Tier

The following example updates the credentials for an S3 remote tier called S3TIER on the myminio deployment.

mc ilm tier update myminio S3TIER --access-key ACCESS_KEY --secret-key SECRET_KEY
  • Replace S3TIER with the name for your Amazon Simple Storage Solution tier.
  • Replace ACCESS_KEY with the updated access key for your S3 storage.
  • Replace SECRET_KEY with the updated secret key for the access key provided.

Rotate Credentials for an Azure Blob Storage Remote Tier

The following example updates the credentials for an Azure remote tier called AXTIER on the myminio deployment.

mc ilm tier update myminio AZTIER --account-key ACCOUNT-KEY
  • Replace AZTIER with the name for your Azure tier.
  • Replace ACCOUNT-KEY with the updated key for your Azure storage.

Rotate Credentials for a Google Cloud Storage Remote Tier

The following example updates the credentials for a Google Cloud Storage remote tier called GCSTIER on the myminio deployment.

 mc ilm tier update myminio GCSTIER --credentials-file /path/to/credentials.json
  • Replace GCSTIER with the name for your Google Cloud Storage tier.
  • Replace /path/to/credentials.json with the path of the updated credential file to use to access the remote storage.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Required Permissions

For permissions required to modify a tier, refer to the required permissions on the parent command.

93 - mc replicate rm

Note

Changed: RELEASE.2022-12-24T15-21-38Z

mc replicate rm replaces the mc admin bucket remote rm command. Removing the replication automatically removes the underlying remote target.

Syntax

The mc replicate rm command removes a replication rule from a MinIO bucket.

The mc replicate remove command has equivalent functionality to mc replicate rm.

mc [GLOBALFLAGS] replicate rm FLAGS [FLAGS] ALIAS

The following command removes the replication rule with specified id from the mydata bucket on the myminio MinIO deployment:

mc replicate rm --id "c76um9h4b0t1ijr36mug" myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] replicate rm     \
                 --id "string"    \
                 [--all --force]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required the alias of the MinIO deployment and full path to the bucket or bucket prefix from which to remove the replication rule. For example:

mc replicate rm --id "ID" myminio/mybucket
--id

mc-cmd

Required Specify the unique ID for a configured replication rule.

You can omit this option if specifying --all

--all

mc-cmd

Optional Removes all replication rules on the specified bucket. Requires specifying the --force flag.

--force

mc-cmd

Optional Required if specifying --all .

Global Flags

This command supports any of the global flags.

Examples

Remove a Replication Rule from a Bucket

Use mc replicate rm to remote a bucket replication rule:

mc replicate rm --id "ID" ALIAS/PATH
  • Replace ID with the unique ID of the replication rule to remove. Use mc replicate ls to list all replication rules for the bucket.
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix.

Remove All Replication Rules from a Bucket

Use mc replicate rm to list bucket replication rules:

mc replicate rm --all --force ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix.

Behavior

Removing Replication Rules Does Not Affect Replicated Objects

Removing one or all replication rule for a bucket does not remove any objects already replicated under those rule(s).

Use The command or mc rb commands to remove replicated objects on the remote target. You can identify replicated objects using the X-Amz-Replication-Status metadata field where the value is REPLICA. Buckets which contain objects from multiple replication sources may require additional care and filtering to determine the source prior to removal.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

94 - mc support proxy

Description

Use the mc support proxy command to configure a proxy to use to communicate with MinIO SUBNET.

Examples

Set a Proxy URL

Define the proxy URL to use when the deployment minio1 communicates to SUBNET. The proxy URL in the example is http://my.proxy.

mc support proxy set minio1 http://my.proxy

Remove the Proxy URL Configured for a Deployment

The following command removes the URL configured as the proxy for the alias minio1.

mc support proxy remove minio1

Disable callhome Logs

The following command shows the URL configured as the proxy for the alias minio1.

mc support proxy show minio1

Syntax

mc support proxy set

mc-cmd

Create a proxy URL for the MinIO deployment to use when communicating with MinIO SUBNET.

mc support proxy set ALIAS PROXY_URL

mc support proxy show

mc-cmd

Display the current proxy URL configured for communicating with MinIO SUBNET.

mc support proxy show ALIAS

mc support proxy remove

mc-cmd

Remove the proxy URL configured for communicating with MinIO SUBNET.

mc support proxy remove ALIAS

Global Flags

This command supports any of the global flags.

95 - mc diff

Syntax

The mc diff mc computes the differences between two filesystem directories or MinIO buckets. mc diff lists only those objects which are missing or which differ in size. mc diff does not compare the contents of objects.

The following command computes the difference between an object on a local filesystem and an object in the mydata bucket on the myminio MinIO deployment:

mc diff ~/mydata/myobject.txt myminio/mydata/myobject.txt

The mc diff command has the following syntax:

mc [GLOBALFLAGS] diff SOURCE TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

SOURCE

mc-cmd

Required The object to compare to the TARGET.

For an object from MinIO, specify the alias and the full path to that object (e.g. bucket and path to object). For example:

mc diff play/mybucket/object.txt ~/mydata/object.txt

For an object from a local filesystem, specify the full path to that object. For example:

mc diff ~/mydata/object.txt play/mybucket/object.txt
TARGET

mc-cmd

Required The object to compare to the SOURCE.

For an object from MinIO, specify the alias and the full path to that object (e.g. bucket and path to object). For example:

mc diff play/mybucket/object.txt ~/mydata/object.txt

For an object from a local filesystem, specify the full path to that object. For example:

mc diff ~/mydata/object.txt play/mybucket/object.txt

Global Flags

This command supports any of the global flags.

Examples

The following example assumes that the play alias exists in the mc configuration file. You can replace play with the alias for your preferred S3-compatible deployment.

See mc alias for more information on aliases.

mc diff play/bucket1 play/bucket2

Behavior

Output Legend

mc diff uses the following legend when formatting the diff output:

FIRST < SECOND - object exists only in FIRST
FIRST > SECOND - object exists only in SECOND
FIRST ! SECOND - Newer object exists in FIRST

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

96 - mc idp ldap update

Description

The mc idp ldap update command modifies an existing set of configurations for an AD/LDAP provider.

The following example changes two of the AD/LDAP configuration settings for the myminio deployment.

mc idp ldap update                                \
            myminio                               \
            lookup_bind_dn=cn=admin,dc=min,dc=io  \
            lookup_bind_password=somesecret

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap update           \
                          ALIAS            \
                          [CFG_PARAM1]     \
                          [CFG_PARAM2]...
  • Replace ALIAS with the alias of a MinIO deployment to update for AD/LDAP integration.

  • Replace the [CFG_PARAM#] with each of the configuration setting key-value pairs in the format of PARAMETER="value".

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment on which to modify an AD/LDAP integration.

For example:

mc idp ldap update myminio                               \
                   lookup_bind_dn=cn=admin,dc=min,dc=io  \
server_addr

mc-cmd

Required

Specify the hostname for the Active Directory / LDAP server. For example:

ldapserver.com:636
Note

srv_record_name automatically identifies the port

If your AD/LDAP server uses DNS SRV Records, do not append the port number to your server_addr value. SRV requests automatically include port numbers when returning the list of available servers.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SERVER_ADDR environment variable.

lookup_bind_dn

mc-cmd

Required

Specify the Distinguished Name (DN) for an AD/LDAP account MinIO uses when querying the AD/LDAP server. Enables Lookup-Bind authentication to the AD/LDAP server.

The DN account should be a read-only access keys with sufficient privileges to support querying performing user and group lookups.

This parameter corresponds with the MINIO_IDENTITY_LDAP_LOOKUP_BIND_DN environment variable.

lookup_bind_password

mc-cmd

Required

Specify the password for the Lookup-Bind user account.

Note

Changed: RELEASE.2023-06-23T20-26-00Z

MinIO redacts this value when returned as part of mc admin config get.

This parameter corresponds with the MINIO_IDENTITY_LDAP_LOOKUP_BIND_PASSWORD environment variable.

user_dn_attributes

mc-cmd

Optional

Note

Added: RELEASE.2024-06-06T09-36-42Z

Comma-separated list of user DN attributes.

Some valid values include, uid,cn,mail,sshPublicKey.

To enable public authentication for LDAP users, pass sshPublicKey as a DN attribute. The user can then use the passed SSH Public Key to log in to SFTP servers.

mc idp ldap update ALIAS user_dn_attributes=sshPublicKey
user_dn_search_base_dn

mc-cmd

Required

Specify the base Distinguished Name (DN) MinIO uses when querying for user credentials matching those provided by an authenticating client.

Separate multiple DNs with a semicolon (;).

For example:

cn=miniousers,dc=myldapserver,dc=net;ou=swengg,dc=min,dc=io

Supports Lookup-Bind mode.

This parameter corresponds with the MINIO_IDENTITY_LDAP_USER_DN_SEARCH_BASE_DN environment variable.

user_dn_search_filter

mc-cmd

Required

Specify the AD/LDAP search filter MinIO uses when querying for user credentials matching those provided by an authenticating client.

Use the %s substitution character to insert the client-specified username into the search string. For example:

(userPrincipalName=%s)

This parameter corresponds with the MINIO_IDENTITY_LDAP_USER_DN_SEARCH_FILTER environment variable.

comment

mc-cmd

Optional

Specify a comment to associate to the AD/LDAP configuration.

This parameter corresponds with the MINIO_IDENTITY_LDAP_COMMENT environment variable.

enabled

mc-cmd

Optional

Set to false to disable the AD/LDAP configuration.

If false, applications cannot generate STS credentials or otherwise authenticate to MinIO using the configured provider.

Defaults to true or “enabled”.

group_search_base_dn

mc-cmd

Optional

Specify a semicolon-separated (;) list of group search base Distinguished Names MinIO uses when performing group lookups.

For example:

cn=miniogroups,dc=myldapserver,dc=net;ou=swengg,dc=min,dc=io

This parameter corresponds with the MINIO_IDENTITY_LDAP_GROUP_SEARCH_BASE_DN environment variable.

group_search_filter

mc-cmd

Optional

Specify an AD/LDAP search filter for performing group lookups for the authenticated user

Use the %s substitution character to insert the client-specified username into the search string. Use the %d substitution character to insert the Distinguished Name of the client-specified username into the search string.

For example:

(&(objectclass=groupOfNames)(memberUid=%s))

When providing an AD/LDAP group search filter, configure a filter that returns the minimum number of relevant groups for the purpose of supporting authentication. Filters that return large group assignments increase the size of associated calls and resources. Functions sensitive to large request or response bodies may exhibit unexpected behaviors as a result.

This parameter corresponds with the MINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER environment variable.

server_insecure

mc-cmd

Optional

Specify on to allow unsecured (non-TLS encrypted) connections to the AD/LDAP server.

MinIO sends AD/LDAP user credentials in plain text to the AD/LDAP server, such that enabling TLS is required to prevent reading credentials over the wire. Using this option presents a security risk where any user with access to network traffic can observe the unencrypted plaintext credentials.

Defaults to off.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SERVER_INSECURE environment variable.

server_starttls

mc-cmd

Optional

Specify on to enable StartTLS connections to an AD/LDAP server.

Defaults to off

For more about StartTLS, refer to section 4.14 of the LDAP RFC 4511 specification.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SERVER_STARTTLS environment variable.

srv_record_name

mc-cmd

Optional

Note

Added: RELEASE.2022-12-12T19-27-27Z

Specify the appropriate value to enable MinIO to select an AD/LDAP server using a DNS SRV record request.

When enabled, MinIO selects an AD/LDAP server by:

  • Constructing the target SRV record name following standard naming conventions.
  • Requesting a list of available AD/LDAP servers.
  • Choosing an appropriate target based on priority and weight.

The configuration examples below presume the AD/LDAP server address is set to example.com and the SRV record protocol is _tcp.

For SRV record names beginning with _ldap, specify ldap. The constructed DNS SRV record name resembles the following:

_ldap._tcp.example.com

For SRV record names with beginning with _ldaps, specify ldaps. The constructed DNS SRV record name resembles the following:

_ldaps._tcp.example.com

If your DNS SRV record name uses alternate service or protocol names, specify on and provide the full record name as your LDAP server address. Example: _ldapserver._specialtcp.example.com

For more about DNS SRV records, see DNS SRV Records for LDAP.

Note

Server address for DNS SRV record configurations

The specified server name must not include a port number. This is different from a standard AD/LDAP configuration, where the port number is required.

See server_addr or MINIO_IDENTITY_LDAP_SERVER_ADDR for more about configuring an AD/LDAP server address.

This parameter corresponds with the MINIO_IDENTITY_LDAP_SRV_RECORD_NAME environment variable.

tls_skip_verify

mc-cmd

Optional

Specify on to trust the AD/LDAP server TLS certificates without verification. This option may be required if the AD/LDAP server TLS certificates are signed by an untrusted Certificate Authority (e.g. self-signed).

Defaults to off

This parameter corresponds with the MINIO_IDENTITY_LDAP_TLS_SKIP_VERIFY environment variable.

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

97 - mc replicate status

Syntax

The mc replicate status command displays the replication status of a MinIO bucket. The status also lists the remote target path or location.

The following command displays the current replication status of the mydata bucket on the myminio MinIO deployment:

mc replicate status myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] replicate status TARGET
                           [--limit-upload value]
                           [--limit-download value]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment and full path to the bucket or bucket prefix for which to display the replication status. For example:

mc replicate status myminio/mybucket
--limit-download

mc-cmd

Optional

Limit download rates to no more than a specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit download rates to no more than 1 GiB/s, use the following:

--limit-download 1G

If not specified, MinIO uses an unlimited download rate.

--limit-upload

mc-cmd

Optional

Limit upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. Valid units include:

  • B for bytes
  • K for kilobytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following:

--limit-upload 1G

If not specified, MinIO uses an unlimited upload rate.

Global Flags

This command supports any of the global flags.

Examples

Display Replication Status

Use mc replicate status to show bucket replication status:

mc replicate status ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix.

Behavior

Removed and Re-added ARNs

Note

Changed: mc

RELEASE.2023-03-20T17-17-53Z

The standard output of this command does not display ARNs previously removed from a replication configuration.

To list all ARNs, including ARNs no longer part of the replication, use the --json flag. The json output continues to show data replicated under old ARNs. This may be valuable if an ARN was removed and re-added for the same bucket.

New ARNs do not cause re-replication of previously synced objects.

98 - mc support top

Note

Note

Note

Changed: RELEASE.2022-08-11T00-30-48Z

mc support top replaces the mc admin top command.

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Description

The mc support top command returns statistics for distributed MinIO deployments, similar to the output of the top command in a shell.

Note

Note

mc support top is not supported on single-node single-drive MinIO deployments.

mc support top has the following subcommands:

Refer to the pages linked above for each subcommand for details.

Syntax

The command has the following syntax:

mc support top COMMAND [COMMAND FLAGS] [ARGUMENTS ...]

99 - mc du

Syntax

The mc du command summarizes the disk usage of buckets and folders. You can also use du against the local filesystem to produce similar results as the du command.

The following command prints the disk usage of the mybucket bucket on the myminio MinIO deployment:

mc du play/mybucket

The output resembles the following:

825KiB 3 objects        mybucket

The mc du command has the following syntax:

mc [GLOBALFLAGS] du                    \
                 [--depth]             \
                 [--recursive]         \
                 [--rewind]            \
                 [--versions]          \
                 ALIAS [ALIAS ...]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of a MinIO deployment and the full path to the folder. For example:

mc du myminio/mybucket

You can specify multiple buckets and folders on the same or different MinIO deployment. For example:

mc du myminio/mybucket myminio/myotherbucket/myfolder

For a folder on a local filesystem, specify the full path to that folder. For example:

mc du ~/data/images

The time required for mc du to complete depends on the size of the target buckets and folders. A large bucket may take some time to generate a disk usage summary.

--depth, d

mc-cmd

Optional

Print the total for all folders N or fewer levels below the path specified in the command. Default is 0, for the specified path only.

--recursive, r

mc-cmd

Optional

Recursively print the total for each bucket or child folder.

--rewind

mc-cmd

Optional

Directs mc du to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --rewind and --versions together to show the disk usage for those object versions which existed at a specific point in time.

--versions

mc-cmd

Optional

Directs mc du to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to show the disk usage for those object versions which existed at a specific point in time.

Global Flags

This command supports any of the global flags.

Examples

View the Disk Usage for a Bucket or Folder

Use mc du to print a summary of the disk usage for a bucket or folder:

mc du ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or folder on the S3-compatible host.

View the Disk Usage at a Point-In-Time

Use mc du --rewind to print a summary of disk usage at a specific point-in-time in the past:

mc du --rewind DURATION ALIAS/PATH
  • Replace DURATION with the desired point-in-time in the past. For example, specify 30d to show the disk usage 30 days prior to the current date.
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or folder on the S3-compatible host.
Note

Requires Versioning

mc du requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

View the Disk Usage Recursively

Use mc du --recursive to print a summary for each folder recursively:

mc du --recursive ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or folder on the S3-compatible host.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

100 - mc replicate export

Syntax

The mc replicate export command exports the JSON-formatted replication rules for a MinIO bucket to STDOUT.

The following command exports the replication configuration for the mydata bucket on the myminio MinIO deployment:

mc replicate export myminio/mydata > mydata-replication.json

The command has the following syntax:

mc [GLOBALFLAGS] export ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required the alias of the MinIO deployment and full path to the bucket or bucket prefix for which to export the replication rules. For example:

mc replicate export myminio/mybucket

Global Flags

This command supports any of the global flags.

Examples

Export Existing Replication Rules

Use mc replicate export to export bucket replication rules:

mc replicate export ALIAS/PATH > bucket-replication-rules.json
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

101 - mc support upload

Description

mc support upload copies a file from the local file system to a SUBNET ticket.

Note

SUBNET Registration Required

The mc support commands are designed for MinIO deployments registered with MinIO SUBNET to ensure optimal outcome of diagnostics and performance testing. Deployments not registered with SUBNET cannot use the mc support commands.

Syntax

The mc support profile command has the following syntax:

mc [GLOBALFLAGS] support profile              \
                         ALIAS                \
                         FILE                 \
                         [--comment "string"] \
                         [--enc]              \
                         [--issue integer]

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment.

FILE

mc-cmd

Required

The path to the file to upload to SUBNET.

--comment

mc-cmd

Optional

Include a message to the issue when uploading the file.

--enc

mc-cmd

Optional

Encrypt contents of the upload. The key used for the encryption is only accessible to MinIO.

--issue

mc-cmd

Optional

Specify the issue number to which to add the file. If not specified, the file uploads to the generic issue number 0.

Global Flags

This command supports any of the global flags.

Examples

Upload a file to an issue

This command uploads the file ./trace.log from the local file system to the SUBNET issue number 10001 for the deployment with alias minio1.

mc support upload --issue 10001 minio1 ./trace.log

Upload a file to an issue with a comment for MinIO Engineers

This command uploads the file ./trace.log from the local file system to the SUBNET issue number 10001 for the deployment with alias minio1. The command also includes a comment available to MinIO Engineers about the file.

mc support upload --issue 10001 --comment "here is the requested trace log" minio1 ./trace.log

102 - mc encrypt

Description

The mc encrypt commands set, update, or disable the default bucket Server-Side Encryption (SSE) mode. MinIO automatically encrypts objects using the specified SSE mode.

Subcommands

mc encrypt includes the following subcommands:

Subcommand

Description

clear

The mc encrypt clear command removes the current default encryption settings for a bucket.

info

The mc encrypt info command returns the current default encryption settings for a bucket.

set

The mc encrypt set encrypt command sets or updates the default bucket Server-Side Encryption (SSE) mode. MinIO automatically encrypts objects written to that bucket using the specified SSE mode.

103 - mc replicate import

Syntax

The mc replicate import command imports JSON-formatted replication rules for a MinIO bucket from STDIN.

The following command imports the replication configuration for the mydata bucket on the myminio MinIO deployment:

mc replicate import myminio/mydata < mydata-replication.json

The command has the following syntax:

mc [GLOBALFLAGS] import ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required the alias of the MinIO deployment and full path to the bucket or bucket prefix for which to import the replication rules. For example:

mc replicate import myminio/mybucket

Global Flags

This command supports any of the global flags.

Examples

Import Existing Replication Rules

Use mc replicate import to import bucket replication rules:

mc replicate import ALIAS/PATH < bucket-replication-rules.json
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket or bucket prefix.

Behavior

Importing Configuration Overrides Existing Rules

mc replicate import replaces the current bucket replication rules with those defined in the imported JSON configuration.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

104 - mc event

Description

The mc event command supports adding, removing, and listing bucket event notifications.

MinIO automatically sends triggered events to the configured notification targets. MinIO supports notification targets like AMQP (RabbitMQ), Redis, ElasticSearch, NATS and PostgreSQL. See MinIO Bucket Notifications for more information.

Subcommands

mc event includes the following subcommands:

Subcommand

Description

add

The mc event add command adds event notification triggers to a bucket.

ls

The mc event ls command lists all event notification triggers for a bucket.

rm

The mc event rm command removes an event notification trigger from a bucket.

105 - mc find

Syntax

The mc find command supports searching for objects on a MinIO deployment. You can also use the command to search for files on a filesystem.

The following command searches for all objects matching the specified pattern in the mydata bucket on the myminio MinIO deployment:

mc find myminio/mydata --name "*.jpg"

The command has the following syntax:

mc [GLOBALFLAGS] find                    \
                 [--exec "string"]       \
                 [--ignore "string"]     \
                 [--larger "string"]     \
                 [--maxdepth "string"]   \
                 [--metadata "string"]   \
                 [--name "string"]       \
                 [--newer-than "string"] \
                 [--older-than "string"] \
                 [--path "string"]       \
                 [--print "string"]      \
                 [--regex "string"]      \
                 [--smaller "string"]    \
                 [--tags "string"]`      \
                 [--versions]            \
                 [--watch]               \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

For objects on MinIO or an S3-compatible host, specify the alias and the full path to search (e.g. bucket and prefixes). For example:

mc find play/mydata/

For objects on a filesystem, specify the full path to search. For example:

mc find ~/mydata/

Issuing mc find ALIAS with no other arguments returns a list of all objects or files at the specified path, similar to mc ls.

--exec

mc-cmd

Optional

Spawns an external process for each object returned by mc find. Supports substitution formatting of the output.

--ignore

mc-cmd

Optional

Exclude objects whose names match the specified wildcard pattern.

--larger

mc-cmd

Optional

Match all objects larger than the specified size in units.

--maxdepth

mc-cmd

Optional

Limits directory navigation to the specified depth.

--metadata

mc-cmd

Optional

Note

Added: mc

RELEASE.2023-04-12T02-21-51Z

For use with MinIO deployments only.

Return objects with metadata that matches a specified key=value. Use the format --metadata="KEY=value".

You can pass a key with an empty value. In that case, mc find matches objects that do not have the metadata key or where the metadata key’s value is empty.

You can use the flag multiple times to match objects for additional metadata keys. To return, an object must have matching values for all metadata keys.

--name

mc-cmd

Optional

Return objects whose names match the specified wildcard pattern.

--newer-than

mc-cmd

Optional

Mirror object(s) newer than the specified number of days. Specify a string in #d#hh#mm#ss format. For example: --older-than 1d2hh3mm4ss

Note

Changed: RELEASE.2025-02-04T04-57-50Z

The datetime may also be specified in absolute time of YYYY-MM-DD HH:MM:SS TMZ format. For example, mc find --newer-than="2025-01-22 09:57:00 CET" minioalias/mybucket.

--older-than

mc-cmd

Optional

Mirror object(s) older than the specified time limit. Specify a string in #d#hh#mm#ss format. For example: --older-than 1d2hh3mm4ss

Note

Changed: RELEASE.2025-02-04T04-57-50Z

The datetime may also be specified in absolute time of YYYY-MM-DD HH:MM:SS TMZ format. For example, mc find --newer-than="2025-01-22 09:57:00 CET" minioalias/mybucket.

Defaults to 0 (all objects).

--path

mc-cmd

Optional

Return the contents of directories whose names match the specified wildcard pattern.

--print

mc-cmd

Optional

Prints results to STDOUT. Supports substitution formatting of the output.

--regex

mc-cmd

Optional

Returns objects or the contents of directories whose names match the specified PCRE regex pattern.

--tags

mc-cmd

Optional

Note

Added: mc

RELEASE.2023-04-12T02-21-51Z

For use with MinIO deployments only.

Return objects with a tag that matches a specified RE2 RegEx pattern. Use the format --tag="KEY=regexValue".

You can pass a key with an empty value. In that case, mc find matches objects that do not have the metadata key or where the metadata key’s value is empty.

You can use the flag multiple times to match objects for additional tags. To return, an object must have matching values for all tags.

--smaller

mc-cmd

Optional

Match all objects smaller than the specified size in units.

--versions

mc-cmd

Optional

Include all object versions in the results.

--watch

mc-cmd

Optional

Continuously monitor the ALIAS and return any new objects which match the specified criteria.

Global Flags

This command supports any of the global flags.

Examples

Find a Specific Object in a Bucket

mc find ALIAS/PATH --name NAME
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to a bucket on the S3-compatible host. Omit the path to search from the root of the S3 host.
  • Replace NAME with the object.

Find Objects with File Extension in Bucket

mc find ALIAS/PATH --name *.EXTENSION
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to a bucket on the S3-compatible host.
  • Replace EXTENSION with the file extension of the object.

Find All Matching Files and Copy To S3 Service

Use mc find with the --exec option to find files on a local filesystem and pass them to an mc command for further processing. The following example uses mc cp to copy the output of mc find to an S3-compatible host.

mc find FILEPATH --name "*.EXTENSION" --exec "mc cp {} ALIAS/PATH"
  • Replace FILEPATH with the full file path to the directory to search.
  • Replace EXTENSION with the file extension of the object.
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to a bucket on the S3-compatible host.

To continuously watch the specified directory and copy new objects, include the --watch argument:

mc find --watch FILEPATH --name "*.EXTENSION" --exec "mc cp {} ALIAS/PATH"

Find Objects with a Matching Tag

Note

Note

Tag matching is only available for use on MinIO deployments.

mc find --tags="key=v*" ALIAS/BUCKET/
  • Replace key with the name of a tag key to match.
  • Replace v* with the RE2 Regular Expression to evaluate against.
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace BUCKET with the bucket or prefix to search.

You can add additional --tags="key=RegExpression" flags to match. Matching objects must match all included tags.

Find Objects with Matching Metadata

Note

Note

Metadata matching is only available for use on MinIO deployments.

mc find --json --metadata="content-type=text/csv" ALIAS/BUCKET/
  • Replace content-type=text/csv with the a key-value pair of the metadata field and value to match.
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace BUCKET with the bucket or prefix to search.

You can add additional --tags="metadata=value" flags to match. Matching objects must match all included metadata fields.

Behavior

Units of Measurement

The mc find --smaller and mc find --larger flags accept the following case-insensitive suffixes to represent the unit of the specified size value:

Suffix Unit Size
k KB (Kilobyte, 1000 Bytes)
m MB (Megabyte, 1000 Kilobytes)
g GB (Gigabyte, 1000 Megabytes)
t TB (Terabyte, 1000 Gigabytes)
ki KiB (Kibibyte, 1024 Bites)
mi MiB (Mebibyte, 1024 Kibibytes)
gi GiB (Gibibyte, 1024 Mebibytes)
ti TiB (Tebibyte, 1024 Gibibytes)

Omitting the suffix defaults to bytes.

Substitution Format

The mc find --exec and mc find --print commands support string substitutions with special interpretations for following keywords.

The following keywords are supported for both filesystem and S3 service targets:

  • {} - Substitutes to full path.
  • {base} - Substitutes to basename of path.
  • {dir} - Substitutes to dirname of the path.
  • {size} - Substitutes to object size of the path.
  • {time} - Substitutes to object modified time of the path.

The following keyword is supported only for S3 service targets:

  • {url} - Substitutes to a shareable URL of the path.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

106 - mc get

Note

Added: mc

RELEASE.2024-02-24T01-33-20Z

Syntax

The mc get command downloads an object from a target S3 deployment to the local file system.

mc get provides a simplified interface for downloading files compared to mc cp or mc mirror. mc get uses a one-way download function that trades efficiency for the power and complexity of the other commands.

The following downloads the file logo.png from an s3 source to the local file system at path ~/images/collateral/.

mc get minio/marketing/logo.png ~/images/collateral

The command has the following syntax:

mc [GLOBALFLAGS] get                      \
                 SOURCE                   \
                 TARGET                   \
                 [--enc-c string]         \
                 [--version-id, --vid value]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

SOURCE

mc-cmd

Required

The full path to the alias, bucket, prefix (if used), and object to download.

TARGET

mc-cmd

Required

The destination path on the local file system where the command should place the downloaded file.

--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--version-id, --vid

mc-cmd

Optional

Retrieve a specific version of the object. Pass the version ID of the object to retrieve.

Global Flags

This command supports any of the global flags.

Examples

Retrieve an object from MinIO to the local file system

The following command retrieves the file myobject.csv from the bucket mybucket at the alias myminio and places it on the local file system at the path /my/local/folder.

mc get myminio/mybucket/myobject.csv /my/local/folder

Retrieve an encrypted object from MinIO

The following command retrieves an encrypted file and places it at a local folder path.

mc get --enc-c "play/mybucket/object=MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDA" play/mybucket/object path-to/object

107 - mc head

Syntax

The mc head command displays the first n lines of an object, where n is an argument specified to the command.

mc head does not perform any transformation or formatting of object contents to facilitate readability. You can also use mc head against the local filesystem to produce similar results to the head commandline tool.

The following command returns the first 10 lines of an object in the mydata bucket on the myminio MinIO deployment:

mc head myminio/mydata/myobject.txt

The command has the following syntax:

mc [GLOBALFLAGS] head                     \
                 [--lines int]            \
                 [--rewind "string"]      \
                 [--version-id "string"]  \
                 [--enc-c "string"]       \
                 ALIAS [ALIAS ...]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The object or objects to print.

For an object on MinIO, specify the alias and the full path to that object (e.g. bucket and path to object). For example:

mc head play/mybucket/object.txt

You can specify multiple objects on the same or different MinIO deployments. For example:

mc head ~/mydata/object.txt myminio/mydata/object.txt

For an object on a local filesystem, specify the full path to that object. For example:

mc head ~/mydata/object.txt
--lines, n

mc-cmd

Optional

The number of lines to print.

Defaults to 10.

--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--rewind

mc-cmd

Optional

Directs mc head to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--version-id, vid

mc-cmd

Optional

Directs mc head to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Global Flags

This command supports any of the global flags.

Examples

View Partial Contents of an Object

Use mc head to return the first 10 lines of an object:

mc head ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.

View Partial Contents of an Object at a Point in Time

Use mc head --rewind to return the first 10 lines of the object at a specific point-in-time in the past:

mc head ALIAS/PATH --rewind DURATION
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.
  • Replace DURATION with the point-in-time in the past at which the command returns the object. For example, specify 30d to return the version of the object 30 days prior to the current date.
Note

Requires Versioning

mc head requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

View Partial Contents of an Object with Specific Version

Use mc head --version-id to return the first 10 lines of the object at a specific point-in-time in the past:

mc head ALIAS/PATH --version-id VERSION
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the object on the S3-compatible host.
  • Replace VERSION with the version of the object. For example, specify 30d to return the version of the object 30 days prior to the current date.
Note

Requires Versioning

mc head requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

108 - mc idp ldap

Note

Added: RELEASE.2023-05-26T23-31-54Z

mc idp ldap and its subcommands replace mc admin idp ldap.

Description

The mc idp ldap commands allow you to manage configurations to 3rd party Active Directory or LDAP Identity and Access Management (IAM) integrations.

The mc idp ldap commands are an alternative to using environment variables when setting up an AD/LDAP connection. They are only supported against MinIO deployments.

See Active Directory / LDAP Access Management for a tutorial on using these commands.

Note

Note

MinIO AD/LDAP environment variables override their corresponding configuration settings as modified or set by this command.

The mc idp ldap command has the following subcommands:

Subcommand

Description

mc idp ldap add

The mc idp ldap add command creates an AD/LDAP IDP server configuration.

mc idp ldap disable

The mc idp ldap disable command disables the currently configured AD/LDAP provider.

mc idp ldap enable

The mc idp ldap enable command enables the currently configured AD/LDAP provider.

mc idp ldap info

The mc idp ldap info command outputs the current configuration for an AD/LDAP provider on a specified MinIO deployment.

mc idp ldap ls

The mc idp ldap ls command lists the existing set of configurations for an AD/LDAP provider.

mc idp ldap policy subcommands

The mc idp ldap policy commands show the mapping relationships between policies and the associated groups or users.

mc idp ldap rm

The mc idp ldap rm command removes the existing configuration for an AD/LDAP provider.

mc idp ldap update

The mc idp ldap update command modifies an existing set of configurations for an AD/LDAP provider.

109 - mc idp ldap accesskey

Note

Added: RELEASE.2023-10-30T18-43-32Z

Description

The mc idp ldap accesskey commands allow you to list, delete, or display information about LDAP access key pairs.

The mc idp ldap accesskey commands are only supported against MinIO deployments.

This command works against access keys created by an AD/LDAP user after authenticating to MinIO.

Create AD/LDAP service accounts with the mc idp ldap accesskey create command.

MinIO supports using AssumeRoleWithLDAPIdentity to generate temporary access keys using the Security Token Service.

The mc idp ldap accesskey command has the following subcommands:

Subcommand

Description

mc idp ldap accesskey create

The mc idp ldap accesskey create allows you to add LDAP access key pairs.

mc idp ldap accesskey disable

mc idp ldap accesskey disable disables the specified access key on the MinIO deployment.

mc idp ldap accesskey edit

mc idp ldap accesskey edit modifies the specified access key on the local server.

mc idp ldap accesskey enable

The mc idp ldap accesskey enable enables the specified access key on the local server.

mc idp ldap accesskey info

The mc idp ldap accesskey info outputs information about the specified access key(s).

mc idp ldap accesskey ls

The mc idp ldap accesskey ls displays a list of LDAP access key pairs.

mc idp ldap accesskey rm

The mc idp ldap accesskey rm deletes the specified access key from the local server.

110 - mc idp ldap accesskey create-with-login

Note

Added: mc

RELEASE.2024-04-18T16-45-29Z

Description

The mc idp ldap accesskey create-with-login uses interactive terminal-based prompt to authenticate with the external AD/LDAP server and generate access keys for use with MinIO.

The following example prompts the user to provide their AD/LDAP credentials. It then generates a new access key pair using the policy or policies associated with that AD/LDAP user.

mc idp ldap accesskey create-with-login https://minio.example.net/

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey create-with-login        \
                                 URL                         \
                                 [--access-key <value>]      \
                                 [--secret-key <value>]      \
                                 [--policy <value>]          \
                                 [--name <value>]            \
                                 [--description <value>]     \
                                 [--expiry <value>]          \
                                 [--expiry-duration <value>]
  • Replace URL with the FQDN of a MinIO deployment configured for AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

URL

mc-cmd

Required

The FQDN of a MinIO deployment configured for AD/LDAP integration.

For example:

mc idp ldap accesskey create-with-login https://minio.example.net
--access-key

mc-cmd

Optional

The access key to use once successfully authenticated. Omit to let MinIO randomly generate a value.

The access key cannot contain the characters = (equal sign) or , (comma).

Requires --secret-key

--secret-key

mc-cmd

Optional

A secret key to use once successfully authenticated. Omit to let MinIO randomly generate a value.

Requires --access-key

--policy

mc-cmd

Optional

File path to the JSON-formatted policy to use for the account. This policy cannot grant additional privileges beyond the privileges associated with the authenticated AD/LDAP user.

Omit to use the AD/LDAP user policies.

--name

mc-cmd

Optional

A human-readable name to use for the created access key.

--description

mc-cmd

Optional

Create a description for the service account. For example, you might specify the reason the access key exists.

--expiry-duration

mc-cmd

Optional

Length of time the access key pair should remain valid for use in #d#h#s format.

For example, 7d, 24h, 5d12h30s are valid strings.

Mutually exclusive with --expiry.

--expiry

mc-cmd

Optional

The date after which the access key expires. Enter the date in YYYY-MM-DD format.

For example, to expire the credentials after December 31, 2024, enter 2024-12-31.

Mutually exclusive with --expiry-duration.

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Examples

Create a new access-key pair for the authenticated user

The following command creates a new access key pair to use with the currently authenticated user on the minio alias. The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create-with-login https://minio.example.net

Create a new access-key pair with a custom access key and secret key

The following command creates a new access key pair with both an access key and secret key that you specify for the user currently authenticated on the minio alias.

mc idp ldap accesskey create-with-login https://minio.example.net/ --access-key my-access-key-change-me --secret-key my-secret-key-change-me

Create a new access-key pair that expires after 24 hours

The following command creates a new access key pair to use with the currently authenticated user on the minio alias. The credentials expire after 24 hours.

The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create-with-login https://minio.example.net --expiry-duration 24h

Create a new access-key pair that expires after a date

The following command creates a new access key pair to use with the currently authenticated user on the minio alias. The credentials expire after February 28, 2025.

The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create-with-login https://minio.example.net --expiry 2025-02-28

111 - mc idp ldap policy

Note

Added: RELEASE.2023-05-26T23-31-54Z

mc idp ldap policy and its subcommands replace mc admin idp ldap policy.

Description

The mc idp ldap policy commands show the mapping relationships between policies and the associated groups or users.

The mc idp ldap policy commands are only supported against MinIO deployments.

The mc idp ldap policy command has the following subcommands:

Subcommand

Description

mc idp ldap policy attach

The mc idp ldap policy attach command attaches one or more polices to an entity.

mc idp ldap policy detach

The mc idp ldap policy detach command detaches one or more polices from an entity.

mc idp ldap policy entities

The mc idp ldap policy entities command displays a list of mappings for a user, group, and/or policy.

112 - mc idp openid

Note

Added: RELEASE.2023-05-26T23-31-54Z

mc idp openid and its subcommands replace mc admin idp openid.

Description

The mc idp openid commands allow you to manage configurations to 3rd party OpenID Identity and Access Management (IAM) integrations.

Define configuration settings as an alternative to using environment variables when setting up an OpenID connection. The mc idp openid commands are only supported against MinIO deployments.

Note

Note

MinIO OpenID environment variables override their corresponding configuration settings as modified or set by this command.

The mc idp openid command has the following subcommands:

Subcommand Description
mc idp openid add Create an OpenID IDP server configuration.
mc idp openid update Modify an existing OpenID IDP server configuration.
mc idp openid rm Remove an OpenID IDP server configuration from a deployment.
mc idp openid ls Outputs a list of the existing OpenID server configurations for a deployment.
mc idp openid info Displays details for a specific OpenID server configuration.
mc idp openid enable Enables an OpenID server configuration.
mc idp openid disable Disables an OpenID server configuration.

Configuration Parameters

The mc idp openid subcommands support configuration parameters. The parameters define the server’s interaction with the IAM provider.

For a more detailed explanation of the configuration parameters, refer to the config setting documentation.

Syntax

add

mc-cmd

Create a new set of configurations for an OpenID provider.

You can run the command multiple times to set up multiple OpenID providers.

When adding multiple OpenID providers, only one can be a JWT Claim-based provider. All others must be role-based providers.

The following example creates the configuration settings for the myminio deployment as defined in a new test-config setup for Dex integration.

 mc idp openid add myminio test-config                                        \
    client_id=minio-client-app                                                \
    client_secret=minio-client-app-secret                                     \
    config_url="http://localhost:5556/dex/.well-known/openid-configuration"   \
    scopes="openid,groups"                                                    \
    redirect_uri="http://127.0.0.1:10000/oauth_callback"                      \
    role_policy="consoleAdmin"

The command has the following syntax:

mc [GLOBALFLAGS] idp openid add               \
                            ALIAS             \
                            [CFG_NAME]        \
                            [CFG_PARAM1]      \
                            [CFG_PARAM2]...
  • Replace ALIAS with the alias of a MinIO deployment to configure for OpenID integration.
  • Replace CFG_NAME with a unique string for this configuration. If not specified, the command creates default configuration values.
  • Replace the [CFG_PARAM#] with each of the configuration setting key-value pairs in the format of PARAMETER="value".

update

mc-cmd

Modify an existing set of configurations for an OpenID provider.

The following example changes two of the configuration settings for the myminio deployment as defined in the test-config setup for Dex integration.

mc idp openid update                      \
              myminio                     \
              test_config                 \
              scopes="openid,groups"      \
              role_policy="consoleAdmin"

The command has the following syntax:

mc [GLOBALFLAGS] idp openid update           \
                            ALIAS            \
                            [CFG_NAME]       \
                            [CFG_PARAM1]     \
                            [CFG_PARAM2]...
  • Replace ALIAS with the alias of a MinIO deployment to configure for OpenID integration.
  • Replace CFG_NAME with a unique string for this configuration. If not specified, the command updates the default configuration.
  • Replace the [CFG_PARAM#] with each of the configuration setting key-value pairs to update in the format of PARAMETER="value".

rm, remove

mc-cmd

Remove an existing set of configurations for an OpenID provider.

The following example removes the test-config settings for the myminio deployment.

mc idp openid rm myminio test_config

The command has the following syntax:

mc [GLOBALFLAGS] idp openid rm          \
                            ALIAS       \
                            [CFG_NAME]
  • Replace ALIAS with the alias of a MinIO deployment to configure for OpenID integration.
  • Replace CFG_NAME with a unique string for this configuration. If not specified, the command removes the default configurations.

ls, list

mc-cmd

Outputs a list of existing configuration sets for OpenID providers.

The following example outputs a list of all OpenID configuration sets defined for the myminio deployment.

mc idp openid ls myminio

The command has the following syntax:

mc [GLOBALFLAGS] idp openid ls ALIAS
  • Replace ALIAS with the alias of a MinIO deployment to list OpenID integrations for.

info

mc-cmd

Outputs the set of values defined for an existing set of server configurations for an OpenID provider.

The following example outputs the configuration settings defined for the test_config set of OpenID settings on the myminio deployment.

mc idp openid info myminio test_config

The command has the following syntax:

mc [GLOBALFLAGS] idp openid info        \
                            ALIAS       \
                            [CFG_NAME]
  • Replace ALIAS with the alias of a MinIO deployment to configure for OpenID integration.
  • Replace CFG_NAME with a unique string for this configuration. If not specified, the information displays for the default server configuration.

enable

mc-cmd

Begin using an existing set of configurations for an OpenID provider.

The following example enables the server configurations defined as test_config on the myminio deployment.

mc idp openid enable       \
              myminio      \
              test_config

The command has the following syntax:

mc [GLOBALFLAGS] idp openid enable     \
                            ALIAS      \
                            [CFG_NAME]
  • Replace ALIAS with the alias of a MinIO deployment to configure for OpenID integration.
  • Replace CFG_NAME with a unique string for this configuration. If not specified, the command enables the default configuration values.

disable

mc-cmd

Stop using a set of configurations for an OpenID provider.

The following example disables the server configurations defined as test_config on the myminio deployment.

mc idp openid disable      \
              myminio      \
              test_config

The command has the following syntax:

mc [GLOBALFLAGS] idp openid disable       \
                            ALIAS         \
                            [CFG_NAME]
  • Replace ALIAS with the alias of a MinIO deployment to configure for OpenID integration.
  • Replace CFG_NAME with a unique string for this configuration. If not specified, the command disables the default configuration values.

Global Flags

This command supports any of the global flags.

113 - mc ilm

Description

The mc ilm commands manage object lifecycle management rules and tiering on a MinIO deployment.

Use these command to

Subcommands

mc ilm includes the following subcommands:

Subcommand

Description

restore

The mc ilm restore command creates a temporary copy of an object archived on a remote tier. The copy automatically expires after 1 day by default.

rule

The mc ilm rule command and its subcommands configure the rules used to transition objects between storage tiers in MinIO’s Lifecycle Management.

tier

The mc ilm tier command and its subcommands configure a remote supported S3-compatible service for MinIO Lifecycle Management: Object Transition (“Tiering”).

114 - mc legalhold

Description

The mc legalhold command sets, removes, or retrieves the object legal hold (WORM) settings for object(s).

Subcommands

mc legalhold includes the following subcommands:

Subcommand

Description

clear

The mc legalhold clear command removes the current legal hold setting for an object or objects.

info

The mc legalhold info command returns the current legal hold setting for an object or objects.

set

The mc legalhold set command enables legal hold Write-Once Read-Many (WORM) object locking on an object or objects.

115 - mc license

Description

The mc license commands work with cluster registration for MinIO SUBNET. Use the commands to register a deployment, display information about the cluster’s current license, or update the license key for a cluster.

Subcommands

mc license includes the following subcommands:

Subcommand

Description

info

The mc license info command displays information about the MinIO deployment’s license status. Specifically, whether the deployment uses the AGPLv3 Open Source license of the MinIO Commercial License.

register

The mc license register command connects your deployment with your MinIO SUBNET account.

update

Use the mc license update command to replace a license key for a deployment.

116 - mc ls

Syntax

The mc ls command lists buckets and objects on MinIO or another S3-compatible service.

You can also use mc ls against the local filesystem to produce similar results as the ls command.

The following command lists all objects and object versions in the mydata bucket on the myminio MinIO deployment:

mc ls --recursive --versions myminio/mydata

The output resembles the following:

[2022-11-08 11:30:24 PST]    52MB  STANDARD log-data.csv
[2022-11-09 12:20:18 PST]    120MB WARM videos/event-2022-11-09.mp4
  • STANDARD marks objects stored on the MinIO deployment
  • WARM marks objects stored on the remote tier with matching name
  • videos/ indicates the prefix for the object

The command has the following syntax:

mc [GLOBALFLAGS] ls              \
                 [--incomplete]  \
                 [--recursive]   \
                 [--rewind]      \
                 [--versions]    \
                 [--summarize]   \
                 ALIAS [ALIAS ...]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The object or objects to copy.

For listing objects on MinIO, specify the alias and the full path to that object (e.g. bucket and path to object). For example:

mc ls play/mybucket/object.txt

For listing objects on a local filesystem, specify the full path to that object. For example:

mc ls ~/mydata/object.txt

If you specify a directory or bucket to ALIAS, you must also specify --recursive to recursively list the contents of that directory or bucket. If you omit the --recursive argument, ls only lists objects in the top level of the specified directory or bucket.

incomplete, -I

mc-cmd

Optional Returns any incomplete uploads on the specified ALIAS bucket.

--recursive, r

mc-cmd

Optional Recursively lists the contents of each bucket or directory in the ALIAS.

--rewind

mc-cmd

Optional

Directs mc ls to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --rewind and --versions together to display on those object versions which existed at a specific point in time.

--versions

mc-cmd

Optional

Directs mc ls to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to display on those object versions which existed at a specific point in time.

--summarize

mc-cmd

Optional Displays summarized information for the specified ALIAS path.

Global Flags

This command supports any of the global flags.

Examples

List Bucket Contents

Use mc ls to list the contents of a bucket:

mc ls [--recursive] ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.

  • Replace PATH with the path to the bucket on the S3-compatible host.

    If specifying the path to the S3 root (ALIAS only), include the --recursive option.

List Object Versions

Use mc ls --versions to list all versions of an object:

mc ls --versions ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or object on the S3-compatible host.
Note

Requires Versioning

mc ls requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

List Bucket Contents at Point in Time

Use mc ls --versions to list all versions of an object:

mc ls --rewind DURATION ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket or object on the S3-compatible host.
  • Replace DURATION with the point-in-time in the past at which the command returns the object. For example, specify 30d to return the version of the object 30 days prior to the current date.
Note

Requires Versioning

mc ls requires bucket versioning to use this feature. Use mc version to enable versioning on a bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

117 - mc mb

Syntax

The mc mb command creates a new bucket or directory at the specified path.

You can also use mc mb against the local filesystem to produce similar results to the mkdir -p commandline tool.

The following command creates a new bucket mydata on the myminio MinIO deployment. The command creates the bucket with object locking enabled.

mc mb --with-locks myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] mb                   \
                 [--ignore-existing]  \
                 [--region "string"]  \
                 [--with-lock]        \
                 [--with-versioning]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The MinIO or other S3-compatible service on which to create the new bucket.

For creating a bucket on MinIO, specify the alias and the name of the bucket. For example:

mc mb play/mybucket

For creating a directory on a local filesystem, specify the full path to that directory. For example:

mc mb ~/mydata/mydir
--ignore-existing, p

mc-cmd

Optional

Directs mc mb to do nothing if the bucket or directory already exists.

--region

mc-cmd

Optional

The region in which to create the specified bucket. Has no effect if the specified ALIAS is a filesystem directory.

If not specified, default value is us-east-1.

--with-lock, l

mc-cmd

Optional

Enables object locking on the specified bucket. Object locking requires, and therefore implies, enabling object versioning.

Warning

Important

You can only enable object locking when creating the bucket. Buckets created without object locking cannot use Bucket Lifecycle Management or Bucket Object Locking functionality.

--with-versioning

mc-cmd

Optional

Enables object versioning on the new bucket. With versioning enabled, by default MinIO allows up to the maximum value of an Int64 versions per object, or over 9.2 quintillion. Define object expiration rules to remove versions of objects no longer needed, such as by the number of versions or the date of versions.

Versioning is required for bucket replication or site replication. Versioning does not imply or require object locking.

Global Flags

This command supports any of the global flags.

Examples

Create Bucket with Object Locking

Use mc mb to create a bucket on an S3-compatible host. The --with-lock option creates the bucket with locking enabled:

mc mb --with-lock ALIAS/BUCKET
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace BUCKET with the bucket to create.

Create a New Bucket in a Specific Region

Use mc mb to create a bucket on an S3-compatible host. The --region option creates the bucket in a desired region.

mc mb --region --region=us-west-2 myminio/mynewbucket

The above command creates a new bucket, mynewbucket on the myminio bucket within the us-west-2 region.

Create a New Bucket with Versioning Enabled

mc mb --with-versioning myminio/myversionedbucket

The above command creates a new bucket, myversionedbucket, on the myminio alias. The new bucket enables object versioning for all objects in the bucket.

Behavior

Bucket Limits Per Deployment

MinIO does not limit the number of buckets you can create on a deployment. However, MinIO recommends no more than 500,000 buckets per deployment as a general guideline.

Bucket Limits for Non-MinIO S3 Services

Certain S3 services may restrict the number of buckets a given user or account can create. For example, Amazon S3 limits each account to 100 buckets. mc mb may return an error if the user has reached bucket limits on the target S3 service.

MinIO Object Storage deployments do not place any limits on the number of buckets each user can create.

Enable Object Locking at Bucket Creation

MinIO follows AWS S3 behavior where you must enable object locking at bucket creation. Buckets created without object locking can never enable object retention or locking.

Enabling bucket locking does not set any object locking or retention settings. Consider enabling bucket locking as standard practice.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

118 - mc mirror

Syntax

The mc mirror command synchronizes content to MinIO deployment, similar to the rsync utility. mc mirror supports filesystems, MinIO deployments, and other S3-compatible hosts as the synchronization source.

Note

Note

mc mirror only synchronizes the current object without any version information or metadata. To synchronize an object’s version history and metadata, consider using mc replicate for bucket replication or mc admin replicate for site replication.

The following command synchronizes content from a local filesystem directory to the mydata bucket on the myminio MinIO deployment.

mc mirror --watch ~/mydata myminio/mydata

The command “watches” for files added or removed on the local filesystem and synchronizes those operations to MinIO until explicitly terminated.

mc mirror --watch updates files changed on the local filesystem to MinIO (see --overwrite). --watch does not remove other files from MinIO not present on the local filesystem (see --remove).

The command has the following syntax:

mc [GLOBALFLAGS] mirror                            \
                 [--active-active]                 \
                 [--attr "string"]                 \
                 [--checksum "value"]              \
                 [--disable-multipart]             \
                 [--dry-run]                       \
                 [--enc-kms "string"]              \
                 [--enc-s3 "string"]               \
                 [--enc-c "string"]                \
                 [--exclude "string"]              \
                 [--exclude-bucket "string"]       \
                 [--exclude-storageclass "string"] \
                 [--limit-download string]         \
                 [--limit-upload string]           \
                 [--md5]                           \
                 [--monitoring-address "string"]   \
                 [--newer-than "string"]           \
                 [--older-than "string"]           \
                 [--overwrite]                     \
                 [--preserve]                      \
                 [--region "string"]               \
                 [--remove]                        \
                 [--retry]                         \
                 [--skip-errors]                   \
                 [--storage-class "string"]        \
                 [--summary]                       \
                 [--watch]                         \
                 SOURCE                            \
                 TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

SOURCE

mc-cmd

Required

The file(s) or object(s) to synchronize to the TARGET S3 host.

For objects on S3-compatible hosts, specify the path to the object as ALIAS/PATH, where:

  • ALIAS is the alias of a configured S3-compatible host, and
  • PATH is the path to the bucket or object. If specifying a bucket, mc mirror synchronizes all objects in the bucket.
mc mirror [FLAGS] play/mybucket/ myminio/mybucket

For files on a filesystem, specify the full filesystem path to the file or directory :

mc mirror [FLAGS] ~/data/ myminio/mybucket

If specifying a directory, mc mirror synchronizes all files in the directory.

TARGET

mc-cmd

Required

The full path to bucket to which mc mirror synchronizes SOURCE objects. Specify the TARGET as ALIAS/PATH, where:

  • ALIAS is the alias of a configured S3-compatible host, and
  • PATH is the path to the bucket.
mc mirror SOURCE play/mybucket

mc mirror uses the object or file names from the SOURCE when synchronizing to the TARGET bucket.

--active-active

mc-cmd

Optional

Establish active-active mirror activities between two sites. The command must be repeated on each site.

For example:

On site A, to mirror from A to B

mc mirror --active-active siteA siteB

On site B, to mirror from B to A

mc mirror --active-active siteB siteA
--attr

mc-cmd

Optional

Add custom metadata for mirrored objects. Specify key-value pairs as KEY=VALUE\;. For example, --attr key1=value1\;key2=value2\;key3=value3.

--checksum

mc-cmd

Optional

Note

Added: RELEASE.2024-10-02T08-27-28Z

Add a checksum to an uploaded object.

Valid values are: - MD5 - CRC32 - CRC32C - SHA1 - SHA256

The flag requires server trailing headers and works with AWS or MinIO targets.

--disable-multipart

mc-cmd

Optional

Disables multipart upload for the synchronization session.

--dry-run

mc-cmd

Optional

Perform a mock mirror operation. Use this operation to test that the mc mirror operation will only mirror the desired objects or buckets.

--enc-kms

mc-cmd

Encrypt or decrypt objects using server-side SSE-KMS encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify an existing data key on the external KMS.

See the mc admin kms key create reference for creating data keys.

For example:

--enc-kms "myminio/mybucket/prefix/object.obj=mybucketencryptionkey"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-kms "myminio/mybucket/prefix/=mybucketencryptionkey"
--enc-s3

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-S3 encryption with KMS-managed keys. Specify the full path to the object as alias/bucket/prefix/object.

For example:

--enc-s3 "myminio/mybucket/prefix/object.obj"

You can specify the parameter multiple times to denote different object(s) to encrypt:

--enc-s3 "myminio/mybucket/foo/fooobject.obj" --enc-s3 "myminio/mybucket/bar/barobject.obj"

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-s3 "myminio/mybucket/foo"
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--exclude

mc-cmd

Optional

Exclude object(s) in the SOURCE path that match the specified object name pattern.

--exclude-bucket

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-03-03T00-13-08Z

Exclude bucket(s) in the SOURCE path that match the specified bucket name pattern.

--exclude-storageclass

mc-cmd

Optional

Exclude object(s) on the SOURCE that have the specified storage class. You can use this flag multiple times in a command to exclude objects from more than one storage class.

Use this to exclude objects with storage classes that require rehydration or restoration of objects, such as migrating from an AWS S3 bucket where some objects have the GLACIER or DEEP_ARCHIVE storage classes.

--limit-download

mc-cmd

Optional

Limit client-side download rates to no more than a specified rate in KiB/s, MiB/s, or GiB/s. This affects only the download to the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit download rates to no more than 1 GiB/s, use the following:

--limit-download 1G

If not specified, MinIO uses an unlimited download rate.

--limit-upload

mc-cmd

Optional

Limit client-side upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. This affects only the upload from the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following:

--limit-upload 1G

If not specified, MinIO uses an unlimited upload rate.

--md5

mc-cmd

Optional

Forces all uploads to calculate MD5 checksums.

--monitoring-address

mc-cmd

Optional

Creates a Prometheus endpoint for monitoring mirroring activity. Specify the local network adapter and port address on which to create the scraping endpoint. Defaults to localhost:8081).

--newer-than

mc-cmd

Optional

Mirror object(s) newer than the specified number of days. Specify a string in #d#hh#mm#ss format For example: --newer-than 1d2hh3mm4ss.

--older-than

mc-cmd

Optional

Mirror object(s) older than the specified time limit. Specify a string in #d#hh#mm#ss format. For example: --older-than 1d2hh3mm4ss.

Defaults to 0 (all objects).

--overwrite

mc-cmd

Optional

Overwrites object(s) on the TARGET.

For example, consider an active mc mirror --overwrite synchronizing content from Source to Destination.

If an object on Source changes, mc mirror --overwrite synchronizes and overwrites any matching file on Destination.

Without --overwrite, if an object already exists on the Destination, the mirror process fails to synchronize that object. mc mirror logs an error and continues to synchronize other objects.

--preserve, a

mc-cmd

Optional

Preserve file system attributes and bucket policy rules of the SOURCE on the TARGET.

--region

mc-cmd

Optional

Specify the string region when creating new bucket(s) on the target.

Defaults to "us-east-1".

--remove

mc-cmd

Optional

Removes object(s) on the Target that do not exist on the Source.

Use the --remove flag to have the same list of objects on both Source and Target.

For example, objects A, B, and C exist on Source. Objects C, D, and E exist on Target.

When running mc mirror --remove, objects A and B synchronize to Target and objects D and E are removed from Target. Since an object C already exists on both, nothing moves from Source to Target.

After the action, only objects A, B, and C exist on both the Source and the Target.

mc mirror --remove does not verify that the contents of object C are the same on both Source and Target, only that an object called C exists on both. To ensure objects on the Source and Target match both names and content, use --overwrite or --watch.

Note

Changed: RELEASE.2023-05-04T18-10-16Z

mc mirror --remove returns an error if the target path is a local filesystem directory that does not exist.

In prior versions, specifying /path/to/directory would result in the removal of the /path/to folder if directory did not exist.

--retry

mc-cmd

Optional

In case of errors during mirror process, retry on each errored object.

--storage-class, sc

mc-cmd

Optional

Set the storage class for the new object(s) on the TARGET.

See the Amazon documentation on Storage Classes for more information on S3 storage classses.

--skip-errors

mc-cmd

Optional

Note

Added: mc

RELEASE.2024-01-28T16-23-14Z

Skip any objects that produce errors while mirroring.

--summary

mc-cmd

Optional

On completion, output a summary of the data that was synchronized.

--watch, w

mc-cmd

Optional

Use --watch flag to mirror objects from Source to Target, where the Target may also have additional objects not present on the Source.

  • --watch continuously synchronizes files from Source to Target until explicitly terminated
  • The Target may have files that do not exist on Source
  • --watch overwrites objects on the Target if a match exists on Source, like the --overwrite flag

Defaults to 0 (all objects).

For example, object A and B exist on the watched Source. Objects A, B, and C exist on the watched Target.

A client writes object D to Source and removes object B.

After the operation, objects A and D exist on the Source. Objects A, C, and D exist on the Target.

Global Flags

This command supports any of the global flags.

Examples

Mirror a Local Directory to an S3-Compatible Host

Use mc mirror to mirror files from a filesystem to an S3 Host:

mc mirror FILEPATH ALIAS/PATH
  • Replace FILEPATH with the full file path to the directory to mirror.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Continuously Mirror a Local Directory to an S3-Compatible Host

Use mc mirror with --watch to continuously mirror files from a filesystem to an S3-compatible host where objects added to or deleted from the filesystem are added to or deleted from the host:

mc mirror --watch FILEPATH ALIAS/PATH
  • Replace FILEPATH with the full file path to the directory to mirror.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.

Continuously Mirror S3 Bucket to an S3-Compatible Host

Use mc mirror with --watch to continuously mirror objects in a bucket on one S3-compatible host to another S3-compatible host where objects added to or deleted from the bucket are added to or deleted from the host.

mc mirror --watch SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace SRCALIAS with alias of a configured S3-compatible host.
  • Replace SRCPATH with the bucket to mirror.
  • Replace TGTALIAS with the alias of a configured S3-compatible host.
  • Replace TGTPATH with the destination bucket.

Mirror Objects from AWS S3 to MinIO Skipping Objects in GLACIER

Use mc mirror with --exclude-storageclass to mirror objects from AWS S3 to MinIO without mirroring objects in GLACIER or DEEP_ARCHIVE storage.

mc mirror --exclude-storageclass GLACIER  \
   --exclude-storageclass DEEP_ARCHIVE SRCALIAS/SRCPATH TGALIAS/TGPATH
  • Replace SRCALIAS with the alias of a configured S3 host.
  • Replace SRCPATH with the bucket to mirror.
  • Replace TGTALIAS with the alias of a configured S3 host.
  • Replace TGTPATH with the destination bucket.

Behavior

Mirror Continues on Failed Object

If an object of the same name exists on the target, MinIO outputs an error for the duplicate object. mc mirror continues to mirror other objects from the source to the destination after the error.

MinIO Trims Empty Prefixes on Object Removal

The mc mirror --watch command continuously synchronizes the source and destination targets for added and deleted objects. This includes automatically removing objects on the destination if they are removed on the source.

For objects updated on the source to also update on the target, use –overwrite. To remove objects from the target that are not on the source, use –remove.

mc mirror --watch relies on the mc removal API for deleting objects. As part of removing the last object in a bucket prefix, mc also recursively removes each empty part of the prefix up to the bucket root. mc only applies the recursive removal to prefixes created implicitly as part of object write operations - that is, the prefix was not created using an explicit directory creation command such as mc mb.

For example, consider a bucket photos with the following object prefixes:

  • photos/2021/january/myphoto.jpg
  • photos/2021/february/myotherphoto.jpg
  • photos/NYE21/NewYears.jpg

photos/NYE21 is the only prefix explicitly created using mc mb. All other prefixes were implicitly created as part of writing the object located at that prefix.

If an mc command removes myphoto.jpg, the removal API automatically trims the empty /january prefix. If a subsequent mc command removes myotherphoto.jpg, the removal API automatically trims both the /february prefix and the now-empty /2021 prefix. If an mc command removes NewYears.jpg, the /NYE21 prefix remains in place since it was explicitly created.

If using mc mirror --watch for operations on a filesystem, mc applies this same behavior by recursively trimming empty directory paths up to the root. However, the mc remove API cannot distinguish between an explicitly created directory path and an implicitly created one. If mc mirror --watch deletes the last object at a filesystem path, mc recursively deletes all empty directories within that path up to the root as part of the removal operation.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

119 - mc mv

Syntax

The mc mv command moves an object from source to the target, such as between MinIO deployments or between buckets on the same MinIO deployment. mc mv also supports moving objects between a local filesystem and MinIO.

You can also use mc mv against the local filesystem to produce similar results to the mv commandline tool.

The following command moves objects from the mydata bucket to the archive bucket on the myminio MinIO deployment:

mc mv --recursive myminio/mydata myminio/archive

The command has the following syntax:

mc [GLOBALFLAGS] mv         \
[--attr "string"]           \
[--disable-multipart]       \
[--enc-kms "string"]        \
[--enc-s3 "string"]         \
[--enc-c "string"]          \
[--limit-download string]   \
[--limit-upload string]     \
[--newer-than "string"]     \
[--older-than "string"]     \
[--preserve]                \
[--recursive]               \
[--storage-class "string"]  \
SOURCE [SOURCE...]          \
TARGET
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

SOURCE

mc-cmd

:required:

mc-cmd

The object or objects to move.

For moving an object from a MinIO bucket, specify the alias and the full path to the object(s) (e.g. bucket and path to objects). For example:

mc mv play/mybucket/object.txt play/myotherbucket/object.txt

For moving an object from a local filesystem, specify the full path to that object. For example:

mc mv ~/mydata/object.txt play/mybucket/object.txt

Specify multiple SOURCE paths to move multiple objects to the specified TARGET. mc rm treats the last specified alias or filesystem path as the TARGET. For example:

mc mv ~/mydata/object.txt play/mydata/otherobject.txt myminio/mydata

If you specify a directory or bucket to SOURCE, you must also specify --recursive to recursively move the contents of that directory. If you omit the --recursive argument, mv only moves objects in the top level of the specified directory or bucket.

TARGET

mc-cmd

Required

The full path to the bucket to which the command moves the object(s) at the specified SOURCE. Specify the alias of a configured S3 service as the prefix to the TARGET path.

For moving an object from MinIO, specify the alias and hte full path to the object(s) (e.g. bucket and path to objects). For example:

mc mv play/mybucket/object.txt play/myotherbucket/object.txt

For moving an object from a local filesystem, specify the full path to that object. For example:

mc mv ~/mydata/object.txt play/mybucket/object.txt

The TARGET object name can differ from the SOURCE to “rename” the object as part of the move operation.

If running mc mv with the --recursive option, mc mv treats the TARGET as the bucket prefix for all objects at the SOURCE.

--attr

mc-cmd

Optional

Add custom metadata for the object. Specify key-value pairs as KEY=VALUE\;. For example, --attr key1=value1\;key2=value2\;key3=value3.

--disable-multipart

mc-cmd

Optional

Disables the multipart upload feature.

Multipart upload breaks an object into a set of separate parts. Each part uploads individually and in any order. If any individual part upload fails, MinIO retries that part without affecting the other parts. After upload completes, the parts combine to restore the original object.

MinIO recommends using multipart upload for any object larger than 100 MB. For more information on multipart upload, refer to the Amazon S3 documentation

--enc-kms

mc-cmd

Encrypt or decrypt objects using server-side SSE-KMS encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify an existing data key on the external KMS.

See the mc admin kms key create reference for creating data keys.

For example:

--enc-kms "myminio/mybucket/prefix/object.obj=mybucketencryptionkey"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-kms "myminio/mybucket/prefix/=mybucketencryptionkey"
--enc-s3

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-S3 encryption with KMS-managed keys. Specify the full path to the object as alias/bucket/prefix/object.

For example:

--enc-s3 "myminio/mybucket/prefix/object.obj"

You can specify the parameter multiple times to denote different object(s) to encrypt:

--enc-s3 "myminio/mybucket/foo/fooobject.obj" --enc-s3 "myminio/mybucket/bar/barobject.obj"

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-s3 "myminio/mybucket/foo"
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--limit-download

mc-cmd

Optional

Limit client-side download rates to no more than a specified rate in KiB/s, MiB/s, or GiB/s. This affects only the download to the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit download rates to no more than 1 GiB/s, use the following:

--limit-download 1G

If not specified, MinIO uses an unlimited download rate.

--limit-upload

mc-cmd

Optional

Limit client-side upload rates to no more than the specified rate in KiB/s, MiB/s, or GiB/s. This affects only the upload from the local device running the MinIO Client. Valid units include:

  • B for bytes
  • K for kilobytes
  • M for megabytes
  • G for gigabytes
  • T for terabytes
  • Ki for kibibytes
  • Mi for mibibytes
  • Gi for gibibytes
  • Ti for tebibytes

For example, to limit upload rates to no more than 1 GiB/s, use the following:

--limit-upload 1G

If not specified, MinIO uses an unlimited upload rate.

--newer-than

mc-cmd

Optional

Remove object(s) newer than the specified number of days. Specify a string in ##d#hh#mm#ss format. For example: --newer-than 1d2hh3mm4ss.

Defaults to 0 (all objects).

--older-than

mc-cmd

Optional

Remove object(s) older than the specified time limit. Specify a string in #d#hh#mm#ss format. For example: --older-than 1d2hh3mm4ss.

Defaults to 0 (all objects).

--preserve, a

mc-cmd

Optional

Preserve file system attributes and bucket policy rules of the SOURCE directories, buckets, and objects on the TARGET bucket(s).

--recursive, r

mc-cmd

Optional

Recursively move the contents of each bucket or directory SOURCE to the TARGET bucket.

--storage-class

mc-cmd

Optional

Set the storage class for the new object(s) on the TARGET.

See the Amazon documentation on Storage Classes for more information on S3 storage classses.

Global Flags

This command supports any of the global flags.

Examples

Move Files from Filesystem to S3-Compatible Host

mc mv [--recursive] FILEPATH ALIAS/PATH
  • Replace FILEPATH with the full file path to the file to move.

    If specifying the path to a directory, include the --recursive flag.

    mc mv removes the files from the source after successfully moving it to the destination.

  • Replace ALIAS with the alias of a configured S3-compatible host.

  • Replace PATH with the destination bucket.

Move a File from Filesystem to S3-Compatible Host with Custom Metadata

Use mc mv with the --attr option to set custom attributes on file(s).

mc mv --attr "ATTRIBUTES" FILEPATH ALIAS/PATH
  • Replace FILEPATH with the full file path to the file to move. mc mv removes the file from the source after successfully moving it to the destination.
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the destination bucket.
  • Replace ATTRIBUTES with one or more comma-separated key-value pairs KEY=VALUE. Each pair represents one attribute key and value.

Move Bucket Between S3-Compatible Services

 mc mv --recursive SRCALIAS/SRCPATH TGTALIAS/TGTPATH
  • Replace SRCALIAS with the alias of a configured S3-compatible host.
  • Replace SRCPATH with the path to the bucket. mc mv removes the bucket and its contents from the source after successfully moving it to the destination.
  • Replace TGTALIAS with the alias of a configured S3-compatible host.
  • Replace TGTPATH with the path to the bucket.

Move File to S3-Compatible Host with Specific Storage Class

Use mc mv with the --storage-class option to set the storage class on the destination S3-compatible host.

mc mv --storage-class CLASS FILEPATH ALIAS/PATH
  • Replace CLASS with the storage class to associate to the files.

  • Replace FILEPATH with the full file path to the file to move. mc mv removes the file from the source after successfully moving it to the destination.

  • Replace ALIAS with the alias of a configured S3-compatible host.

  • Replace PATH with the destination bucket.

  • Replace ATTRIBUTES with one or more comma-separated key-value pairs KEY=VALUE. Each pair represents one attribute key and value.

    mc mv –storage-class REDUCED_REDUNDANCY myobject.txt play/mybucket

Behavior

Object Names on Move

MinIO uses the SOURCE object name when moving the object to the TARGET if no explicit target object name is specified.

You can specify a different object name for the TARGET with the same object path to “rename” an object. For example:

mc mv play/mybucket/object.txt play/mybucket/myobject.txt

For recursive move operations (mc mv --recursive), MinIO treats the TARGET path as a prefix for objects on the SOURCE.

Checksum Verification

mc mv verifies all move operations to object storage using MD5SUM checksums.

MinIO Trims Empty Prefixes on Object Removal

mc mv relies on the mc removal API for deleting objects. As part of removing the last object in a bucket prefix, mc also recursively removes each empty part of the prefix up to the bucket root. mc only applies the recursive removal to prefixes created implicitly as part of object write operations - that is, the prefix was not created using an explicit directory creation command such as mc mb.

For example, consider a bucket photos with the following object prefixes:

  • photos/2021/january/myphoto.jpg
  • photos/2021/february/myotherphoto.jpg
  • photos/NYE21/NewYears.jpg

photos/NYE21 is the only prefix explicitly created using mc mb. All other prefixes were implicitly created as part of writing the object located at that prefix.

If an mc command removes myphoto.jpg, the removal API automatically trims the empty /january prefix. If a subsequent mc command removes myotherphoto.jpg, the removal API automatically trims both the /february prefix and the now-empty /2021 prefix. If an mc command removes NewYears.jpg, the /NYE21 prefix remains in place since it was explicitly created.

If using mc mv for operations on a filesystem, mc applies this same behavior by recursively trimming empty directory paths up to the root. However, the mc remove API cannot distinguish between an explicitly created directory path and an implicitly created one. If mc mv deletes the last object at a filesystem path, mc recursively deletes all empty directories within that path up to the root as part of the removal operation.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

120 - mc od

Syntax

The mc od command copies a local file to a remote location in a specified number of parts and part sizes. The command outputs the time it took to upload the file.

Use the mc od to mimic the functionality of the Linux dd command.

The following command Upload 200MiB of a file to a bucket in 5 parts of size 40MiB. The output shows the results of the upload, including the length of time it took for the upload to complete.

mc od if=file.zip of=myminio/mybucket/file.zip size=40MiB parts=5

If passing the --json global flag, the output of the command resembles the following:

{
  "source": "home/user/file.zip"
  "target": "myminio/mybucket/file.zip"
  "partSize": 41943040
  "totalSize": 209715200
  "parts": 5
  "elapsed": "314ms"
}

The command has the following syntax:

mc [GLOBALFLAGS] od                                            \
                 if=<path of source file to upload>            \
                 of=<target MinIO path to upload to>           \
                 [size=<size of file>]                         \
                 [parts=<number of parts to split file into>]  \
                 [skip=<number of parts to skip>]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

if

mc-cmd

Required

The path of the source object to use for the upload. Use the full path relative to your current location.

mc od if=file.zip of=myminio/mybucket/file.zip
of

mc-cmd

Required

The full target path to upload the object to.

size

mc-cmd

Optional

The size for each part of the file to upload. If not specified, MinIO determines the size for parts from the source stream.

parts

mc-cmd

Optional

The number of parts to divide the object into for uploading. If not specified, MinIO determines the number of parts based on the size of the source stream.

skip

mc-cmd

Optional

The number of parts of the file to skip during the upload. For example, use this option to test the upload speed for a large file of many parts on only a portion of the object’s parts.

Global Flags

This command supports any of the global flags.

Examples

Upload a Full File with 40MiB Parts

Use mc od to upload a file to MinIO in a set of parts of specified size. The size option allows you to specify the desired part size.

mc od if=file.zip of=myminio/mybucket/file.zip size=40MiB
  • Replace myminio/mybucket/file.zip with the path of the object or file stream to upload.
  • Replace size with the desired size of the object parts.

MinIO examines the source file and divides it into the necessary number of parts so that no part is larger than the specified 40MiB part size.

Upload a First Five 40 MiB Parts of a File

Use mc od to upload parts of a file to MinIO of specified part size. The size option allows you to specify the desired part size. The parts option allows you to specify the total number of parts to use for the object.

mc od if=file.zip of=myminio/mybucket/file.zip size=40MiB parts=5
  • Replace myminio/mybucket/file.zip with the path of the object or file stream to upload.
  • Replace size with the desired size of the object parts.
  • Replace parts with the number of desired parts to use for the object.

In this command example, if the source object stream is larger than 200MiB (40MiB × 5 parts), only the first 200MiB of the file upload.

Warning

Important

Using the command this way may not upload the entirety of an object.

Upload a Full File in 5 Parts

Take a source file, divide the file into a specified number of parts, then upload all parts of the file to a MinIO target.

mc od if=file.zip of=myminio/mybucket/file.zip parts=5

The above command divides the source file into five equal parts, then uploads those parts.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

121 - mc ping

Syntax

The mc ping command performs a liveness check on a specified target.

The following sends a response request to the target(s) and outputs the minimum, maximum, average, and roundtrip times of the response, as well as the number of errors encountered when processing the request.

mc ping play --count 5

The command pings the deployment at the alias play for five cycles. The output resembles the following:

1: https://play.min.io   min=213.00ms   max=213.00ms   average=213.00ms   errors=0   roundtrip=213.00ms
2: https://play.min.io   min=67.15ms    max=213.00ms   average=140.07ms   errors=0   roundtrip=67.15ms
3: https://play.min.io   min=67.15ms    max=213.00ms   average=115.85ms   errors=0   roundtrip=67.41ms
4: https://play.min.io   min=61.26ms    max=213.00ms   average=102.20ms   errors=0   roundtrip=61.26ms
5: https://play.min.io   min=61.26ms    max=213.00ms   average=95.03ms    errors=0   roundtrip=66.36ms

The command has the following syntax:

mc [GLOBALFLAGS] ping                       \
                 TARGET                     \
                 [--count, -c value]        \
                 [--error-count, -e value]  \
                 [--interval, -i value]     \
                 [--distributed, -a value]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--count

mc-cmd

Optional

Specify the number of times to perform the check.

If not specified, the liveness check performs continuously until stopped.

--error-count

mc-cmd

Optional

Specify a number of errors to receive before exiting.

For example, to stop the ping process after receiving five errors, use

mc ping TARGET -e 5
--exit

mc-cmd

Optional

Note

Added: RELEASE.2023-05-30T22-41-38Z

Exit after the first successful check.

--interval

mc-cmd

Optional

The length of time in seconds to wait between requests.

By default, the command waits 1 second between requests.

--distributed

mc-cmd

Optional

Send requests to all servers in the MinIO cluster.

Note

Note

Use this option for distributed deployments where you have direct access to each node or pod. This flag does not work when nodes are placed behind a service, such as a load balancer.

Global Flags

This command supports any of the global flags.

Examples

Return Latency and Liveness for 5 Requests

The following command sends a liveness check for a deployment with the alias myminio five times, outputs the result of each check, then ends.

mc ping myminio --count 5

Send Liveness Checks Repeatedly with 5 Minute Wait Between Each Request

The following command sends continuous liveness check requests with an interval of 5 minutes (300 seconds) between each request.

mc ping myminio --interval 300

End Liveness Checks for Error Counts Greater Than 20

The following command sends continuous liveness checks until 20 errors have been encountered:

mc ping myminio --error-count 20

122 - mc pipe

Syntax

The mc pipe command streams content from STDIN to a target object.

The following command writes contents of STDIN to an S3 compatible storage.

echo "My Meeting Notes" | mc pipe s3/engineering/meeting-notes.txt

The command has the following syntax:

mc [GLOBALFLAGS] pipe                              \
                 TARGET                            \
                 [--attr "string"]                 \
                 [--checksum "string"]             \
                 [--enc-kms "string"]              \
                 [--enc-s3 "string"]               \
                 [--enc-c "string"]                \
                 [--storage-class, --sc "string"]  \
                 [--tags "string"]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Note

Changed: RELEASE.2023-01-11T03-14-16Z

mc pipe now supports concurrent uploads for better throughput of large streams.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--attr

mc-cmd

Optional

Add custom metadata for the object.

Specify key-value pairs as KEY=VALUE\;, separating each pair with a back slash and semicolon (\;). For example, --attr key1=value1\;key2=value2\;key3=value3.

--checksum

mc-cmd

Optional

Note

Added: RELEASE.2024-10-02T08-27-28Z

Add a checksum to an uploaded object.

Valid values are: - MD5 - CRC32 - CRC32C - SHA1 - SHA256

The flag requires server trailing headers and works with AWS or MinIO targets.

--enc-kms

mc-cmd

Encrypt or decrypt objects using server-side SSE-KMS encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify an existing data key on the external KMS.

See the mc admin kms key create reference for creating data keys.

For example:

--enc-kms "myminio/mybucket/prefix/object.obj=mybucketencryptionkey"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-kms "myminio/mybucket/prefix/=mybucketencryptionkey"
--enc-s3

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-S3 encryption with KMS-managed keys. Specify the full path to the object as alias/bucket/prefix/object.

For example:

--enc-s3 "myminio/mybucket/prefix/object.obj"

You can specify the parameter multiple times to denote different object(s) to encrypt:

--enc-s3 "myminio/mybucket/foo/fooobject.obj" --enc-s3 "myminio/mybucket/bar/barobject.obj"

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-s3 "myminio/mybucket/foo"
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--storage-class, --sc

mc-cmd

Optional

Set the storage class for the new object at the TARGET.

See Amazons documentation for more information on S3 storage classes.

--tags

mc-cmd

Optional

Applies one or more tags to the TARGET.

Specify an ampersand-separated list of key-value pairs as KEY1=VALUE1&KEY2=VALUE2, where each pair represents one tag to assign to the objects.

Global Flags

This command supports any of the global flags.

Examples

Write Contents of STDIN to the Local Filesystem

The following command writes the contents of STDIN to the /tmp folder on the local filesystem.

mc pipe /tmp/hello-world.go

Copy an ISO Image to S3 Storage

The following command first streams the contents of an iso image for Debian and then uses the stream to create the object at an S3 path.

cat debian-live-11.5.0-amd64-mate.iso | mc pipe s3/opensource-isos/debian-11-5.iso

Stream MySQL Database Dump to S3

The following command first streams a MySQL database and uses the stream to create a backup on S3 with mc pipe:

mysqldump -u root -p ******* accountsdb | mc pipe s3/sql-backups/backups/accountsdb-sep-28-2022.sql

Write a File to a Reduced Redundancy Storage Class

The following command takes the STDIN stream and creates an object on the Reduced Redundancy storage class on S3.

 mc pipe --storage-class REDUCED_REDUNDANCY s3/personalbuck/meeting-notes.txt

Copy a File to a MinIO Deployment with Metadata

The following command uploads an MP3 file to a MinIO deployment with an ALIAS of myminio and a music bucket. The object writes with some metadata for Cache-Control and Artist.

cat music.mp3 | mc pipe --attr "Cache-Control=max-age=90000,min-fresh=9000;Artist=Unknown" myminio/music/guitar.mp3

Set Tags on Uploaded Objects

The following command creates an object on a MinIO deployment with an ALIAS of myminio in bucket mybucket with two tags. MinIO supports adding up to 10 custom tags to an object.

tar cvf - . | mc pipe --tags "category=prod&type=backup" myminio/mybucket/backup.tar

123 - mc put

Note

Added: mc

RELEASE.2024-02-24T01-33-20Z

Syntax

The mc put uploads an object from the local file system to a bucket on a target S3 deployment.

mc put provides a simplified interface for uploading files compared to mc cp or mc mirror. mc put uses a one-way upload function that trades efficiency for the power and complexity of the other commands.

The following uploads the file logo.png from the local file system at path ~/images/collateral/ to a bucket called marketing on the MinIO deployment with the alias of minio.

mc put ~/images/collateral/logo.png minio/marketing

The command has the following syntax:

mc [GLOBALFLAGS] put                            \
                 TARGET                         \
                 [--checksum value]             \
                 [--disable-multipart]          \
                 [--enc-kms value]              \
                 [--enc-s3 value]               \
                 [--enc-c value]                \
                 [--if-not-exists]              \
                 [--parallel, -P integer]       \
                 [--part-size, -s string]       \
                 [--storage-class, -sc string]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run. The TARGET must contain an alias and bucket name.

The TARGET may also contain the following optional components: - PREFIX where the object should upload to - OBJECT-NAME to use in place of the file names

Valid TARGETs could take any of the following forms: - ALIAS/BUCKET - ALIAS/BUCKET/PREFIX - ALIAS/BUCKET/OBJECT-NAME - ALIAS/BUCKET/PREFIX/OBJECT-NAME

--checksum

mc-cmd

Optional

Note

Added: RELEASE.2024-10-02T08-27-28Z

Add a checksum to an uploaded object.

Valid values are: - MD5 - CRC32 - CRC32C - SHA1 - SHA256

The flag requires server trailing headers and works with AWS or MinIO targets.

--disable-multipart

mc-cmd

Optional

Note

Added: RELEASE.2024-10-02T08-27-28Z

Disables multipart uploads and directs mc to send the object in a single PUT operation.

--enc-kms

mc-cmd

Encrypt or decrypt objects using server-side SSE-KMS encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify an existing data key on the external KMS.

See the mc admin kms key create reference for creating data keys.

For example:

--enc-kms "myminio/mybucket/prefix/object.obj=mybucketencryptionkey"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-kms "myminio/mybucket/prefix/=mybucketencryptionkey"
--enc-s3

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-S3 encryption with KMS-managed keys. Specify the full path to the object as alias/bucket/prefix/object.

For example:

--enc-s3 "myminio/mybucket/prefix/object.obj"

You can specify the parameter multiple times to denote different object(s) to encrypt:

--enc-s3 "myminio/mybucket/foo/fooobject.obj" --enc-s3 "myminio/mybucket/bar/barobject.obj"

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-s3 "myminio/mybucket/foo"
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--parallel, --P

mc-cmd

Optional

For multi-part uploads, specify the number of parts of the object to upload in parallel.

If not defined, defaults to a value of 4.

--part-size, -s

mc-cmd

Optional

Specify the size to use for each part of a multi-part upload.

If not defined, defaults to a value of 16MiB.

--storage-class, -sc

mc-cmd

Optional

Set the storage class for the uploaded object.

See Standard Storage Class for more about storage classes.

Global Flags

This command supports any of the global flags.

Examples

Upload a File and Specify the Object Name

The following command uploads the file logo.png from the local file system to the business bucket on the minio deployment, uploading it on the destination as company-logo.png.

mc put images/collateral/logo.png minio/business/company-logo.png

Upload a Multipart Object in Parallel with a Specified Part Size

The following command uploads a file in chunks of 20MiB each and uploads 8 parts of the file in parallel. 8 parts are uploaded in succession until all parts of the object have uploaded.

mc put ~/videos/collateral/splash-page.mp4 minio/business --parallel 8 --part-size 20MiB

124 - mc rb

Syntax

The mc rb command removes one or more buckets on MinIO or another S3-compatible service.

To remove only the contents of a bucket, use mc rm instead.

Warning

Important

mc rb permanently deletes bucket(s) on the target deployment, including any and all object versions and bucket configurations such as lifecycle management or replication.

You can also use mc rb against the local filesystem to produce similar results to the rm --rf commandline tool.

The following command removes the mydata bucket on the myminio MinIO deployment:

mc rb --force myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] rb             \
                 --force        \
                 [--dangerous]  \
                 ALIAS [ALIAS...]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The alias of a MinIO or other S3-compatible service and the full path to the bucket to remove. For example:

mc rb --force myminio/mydata

Omit the bucket path to perform a site-wide removal of buckets on the MinIO deployment. This operation requires specifying --dangerous to explicitly acknowledge the permanent removal of all data on the deployment. For example:

mc rb --force --dangerous myminio

For removing a directory and its contents on a local filesystem, specify the full path to that directory. The --force flag is ignored if specified. For example:

mc rb ~/data/myolddata

You can specify multiple ALIAS targets consisting of either MinIO or local filesystem directories. The command attempts to remove all specified targets. For example:

mc rb --force myminio/mydata ~/data/myolddata
--force

mc-cmd

Required Safety flag to confirm removal of the bucket contents.

--dangerous

mc-cmd

Optional Directs mc rb to perform a site-wide removal of all buckets on each specified ALIAS (e.g. myminio/).

If any ALIAS specifies a filesystem directory, this option results in the removal of all subdirectories and files at that directory path similar to rm --rf.

Caution

Warning

Running mc rb --dangerous is irreversible. Exercise all possible due diligence in ensuring the command applies to only the desired ALIAS targets prior to execution.

Global Flags

This command supports any of the global flags.

Example

Remove a Bucket

mc rb --force ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.
  • Replace PATH with the path to the bucket to remove.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

125 - mc ready

Syntax

The mc ready command checks the status of a cluster and whether the cluster has read and write quorum.

The following sends a GET request to the cluster at alias myminio and returns its status.

mc ready myminio

The command sends a GET request to the deployment at the alias myminio.’ The command repeats the request until it is successful.

The output before the cluster at alias myminio is ready resembles the following:

The cluster `myminio` is unreachable: Get "http://myminio.example.com:9000/minio/health/cluster": dial tcp 198.51.100.0:9000: connect: connection refused

Once the request succeeds in connecting to the myminio deployment, the output resembles the following:

The cluster `myminio` is ready

The command has the following syntax:

mc [GLOBALFLAGS] ready            \
                 TARGET           \
                 [--cluster-read] \
                 [--maintenance]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the alias or prefix where the command should run.

--cluster-read

mc-cmd

Optional

Checks if the cluster has enough quorum to serve READ requests.

--maintenance

mc-cmd

Optional

Checks if the cluster can maintain read and write quorum if the node for the alias is taken down for maintenance.

Use an alias for the specific node you expect to take down for maintenance and not an alias set to a load balancer.

Global Flags

This command supports any of the global flags.

Examples

Check if the cluster has read quorum

The following command checks that a deployment has sufficient drives available for read operations.

mc read myminio --cluster-read

Check if a cluster is down for maintenance

The following command checks whether the cluster can maintain read and write quorum during maintenance when the node at alias myminio is taken down.

mc ready myminio --maintenance

126 - mc replicate

Description

The mc replicate command configures and manages the Server-Side Bucket Replication for a MinIO deployment, including active-active replication configurations and resynchronization.

Note

Note

For multi-site replication, see mc admin replicate.

Subcommands

mc replicate includes the following subcommands:

Subcommand

Description

add

The mc replicate add command creates a new server-side replication rule for a bucket on a MinIO deployment.

backlog

The mc replicate backlog shows a list of unreplicated new or deleted objects.

export

The mc replicate export command exports the JSON-formatted replication rules for a MinIO bucket to STDOUT.

import

The mc replicate import command imports JSON-formatted replication rules for a MinIO bucket from STDIN.

ls

The mc replicate ls command lists all replication rules on a MinIO bucket.

resync

The mc replicate resync command resynchronizes all objects in the specified MinIO bucket to a remote replication target.

rm

The mc replicate rm command removes a replication rule from a MinIO bucket.

status

The mc replicate status command displays the replication status of a MinIO bucket. The status also lists the remote target path or location.

update

The mc replicate update command modifies an existing bucket replication rule.

127 - mc retention

Description

The mc retention command configures the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also set the default object lock settings for a bucket, where all objects without explicit object lock settings inherit the bucket default.

Subcommands

mc retention includes the following subcommands:

Subcommand

Description

clear

The mc retention clear command removes the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also remove the default object lock settings for a bucket.

info

The mc retention info command configures the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also set the default object lock settings for a bucket, where all objects without explicit object lock settings inherit the bucket default.

set

The mc retention set command configures the Write-Once Read-Many (WORM) locking settings for an object or object(s) in a bucket. You can also set the default object lock settings for a bucket, where all objects without explicit object lock settings inherit the bucket default.

128 - mc rm

Syntax

The mc rm command removes objects from a bucket on a MinIO deployment. To completely remove a bucket, use mc rb instead.

You can also use mc rm against the local filesystem to produce similar results to the rm commandline tool.

For more information on how MinIO performs DELETE actions on objects, see Object Deletion.

Warning

Important

mc rm supports removing multiple objects or files in a single command. Consider using the --dry-run option to validate that the operation targets only the desired objects/files.

The following command removes multiple objects from the mydata bucket on the myminio MinIO deployment:

mc rm --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] rm  \
                 [--bypass]               \
                 [--dangerous]            \
                 [--dry-run]              \
                 [--force]*               \
                 [--incomplete]           \
                 [--newer-than "string"]  \
                 [--non-current]          \
                 [--older-than "string"]  \
                 [--recursive]            \
                 [--rewind "string"]      \
                 [--stdin]                \
                 [--version-id "string"]* \
                 [--versions]             \
                 ALIAS [ALIAS ...]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc rm --force is required by multiple parameters. mc rm --version-id is mutually exclusive with multiple parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The alias of a MinIO deployment and the full path to the object to remove. For example:

mc rm play/mybucket/object.txt

You can specify multiple objects on the same or different MinIO deployments. For example:

mc rm play/mybucket/object.txt play/mybucket/otherobject.txt

If specifying the path to a bucket or bucket prefix, you must also specify the --recursive and --force arguments. For example:

mc rm --recursive --force play/mybucket/

mc rm --recursive --force play/mybucket/myprefix/

Consider first running the command with the --dry-run flag to validate the scope of the recursive delete operation.

For removing a file from a local filesystem, specify the full path to that file:

mc rm ~/data/myoldobject.txt
--bypass

mc-cmd

Optional

Allows removing an object held under GOVERNANCE object locking.

--dangerous

mc-cmd

Optional

Allows running mc rm when the ALIAS specifies the root (all buckets) on the MinIO deployment.

When combined with --versions, this flag directs mc rm to permanently remove all objects and versions from the ALIAS target.

Consider first running the command with the --dry-run to validate the scope of the site-wide delete operation.

Caution

Warning

Running mc rm --dangerous with the --versions flag is irreversible. Exercise all possible due diligence in ensuring the command applies to only the desired ALIAS targets prior to execution.

--dry-run

mc-cmd

Optional

Outputs the results of a command without actually removing any files. Use this flag to test that your command configuration removes only the objects you wish to remove.

--force

mc-cmd

Optional

Allows running mc rm with any of the following arguments:

--incomplete, I

mc-cmd

Optional

Remove incomplete uploads for the specified object.

If any ALIAS specifies a bucket, you must also specify --recursive and --force.

--newer-than

mc-cmd

Optional

Remove object(s) newer than the specified number of days. Specify a string in #d#hh#mm#ss format. For example: --newer-than 1d2hh3mm4ss

Defaults to 0 (all objects).

--non-current

mc-cmd

Optional

Removes all non-current object versions from the specified ALIAS.

This option has no effect on buckets without versioning enabled.

--older-than

mc-cmd

Optional

Remove object(s) older than the specified time limit. Specify a string in #d#h#m#s format. For example: --older-than 1d2h3m4s.

Defaults to 0 (all objects).

--recursive, r

mc-cmd

Optional

Recursively remove the contents of each ALIAS bucket or bucket prefix.

If specifying --recursive, you must also specify --force.

For buckets with versioning enabled, this option by default produces a delete marker for each removed object. Include the --versions flag to recursively remove all objects and object versions from the bucket.

Consider first running the command with the --dry-run flag to validate the scope of the recursive delete operation.

Mutually exclusive with mc rm --version-id

--rewind

mc-cmd

Optional

Directs mc rm to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--stdin

mc-cmd

Optional

Read object names or buckets from STDIN.

--versions

mc-cmd

Optional

Directs mc rm to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to remove all object versions which existed at a specific point in time.

--version-id, vid

mc-cmd

Optional

Directs mc rm to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with any of the following flags:

Global Flags

This command supports any of the global flags.

Examples

Remove a Single Object

mc rm ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible service.
  • Replace PATH with the path to the object.

Recursively Remove a Bucket’s Contents

Use mc rm with the --recursive and --force options to recursively remove a bucket’s contents.

mc rm --recursive --force ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible service.
  • Replace PATH with the path to the bucket.

This operation does not remove the bucket. Use mc rb to remove the bucket along with all contents and associated configurations.

Remove All Incomplete Upload Files for an Object

Use mc rm with the --incomplete option to remove incomplete upload files for an object.

mc rm --incomplete --recursive --force ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible service.
  • Replace PATH with the path to the object.

Roll Object Back To Previous Version

Use mc rm with --versions and --newer-than to remove all object versions newer than the specified duration of time. This effectively “rolls back” the object to its state at that time.

Warning

Important

Removing specific versions of an object is a destructive action. You cannot restore the deleted object versions.

mc rm ALIAS/PATH --versions --newer-than DURATION
  • Replace ALIAS with the alias of a configured S3-compatible service.
  • Replace PATH with the path to the object. For example, /mybucket/myobject.
  • Replace DURATION with the number of days in the past from the current host time from which the operation begins removing versions of the object. For example, to remove all versions of the object created in the last 30 days, specify "30d".

Behavior

Deleting Bucket Contents

Using mc rm to remove all contents in a bucket does not delete the bucket itself. Any configurations associated to the bucket remain in place, such as default object lock settings.

To completely remove a bucket, use mc rb instead of mc rm.

MinIO Trims Empty Prefixes on Object Removal

mc rm relies on the mc removal API for deleting objects. As part of removing the last object in a bucket prefix, mc also recursively removes each empty part of the prefix up to the bucket root. mc only applies the recursive removal to prefixes created implicitly as part of object write operations - that is, the prefix was not created using an explicit directory creation command such as mc mb.

For example, consider a bucket photos with the following object prefixes:

  • photos/2021/january/myphoto.jpg
  • photos/2021/february/myotherphoto.jpg
  • photos/NYE21/NewYears.jpg

photos/NYE21 is the only prefix explicitly created using mc mb. All other prefixes were implicitly created as part of writing the object located at that prefix.

If an mc command removes myphoto.jpg, the removal API automatically trims the empty /january prefix. If a subsequent mc command removes myotherphoto.jpg, the removal API automatically trims both the /february prefix and the now-empty /2021 prefix. If an mc command removes NewYears.jpg, the /NYE21 prefix remains in place since it was explicitly created.

If using mc rm for operations on a filesystem, mc applies this same behavior by recursively trimming empty directory paths up to the root. However, the mc remove API cannot distinguish between an explicitly created directory path and an implicitly created one. If mc rm deletes the last object at a filesystem path, mc recursively deletes all empty directories within that path up to the root as part of the removal operation.

Delete Operations in Versioned Buckets

MinIO supports keeping multiple versions of an object in a single bucket. Deleting an object in a versioned bucket results in a special DeleteMarker tombstone that marks an object as deleted while retaining all previous versions of that object.

Note

Changed: mc

RELEASE.2023-03-20T17-17-53Z

The output shows the modification time of versioned files. When used with --dry-run, this can help confirm that you selected the correct object(s) for removal.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

129 - mc share

Description

Use the mc share commands to manage presigned URLs for downloading and uploading objects to a MinIO bucket.

Subcommands

mc share includes the following subcommands:

Subcommand

Description

download

The mc share download command generates a temporary presigned URL with integrated access credentials for downloading objects from a MinIO bucket. The temporary URL expires after a configurable time limit.

list

The mc share ls command displays any unexpired presigned URLs generated by mc share upload or mc share download

upload

The mc share upload command generates a temporary presigned URL with integrated access credentials for uploading objects to a MinIO bucket. The temporary URL expires after a configurable time limit.

130 - mc sql

Syntax

The mc sql command provides an S3 Select interface for performing sql queries on objects in the specified MinIO deployment.

See Selecting content from objects for more information on S3 Select behavior and limitations.

The following command queries all objects in the mydata bucket on the myminio MinIO deployment:

mc sql --recursive --query "select * from S3Object" myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] mc sql                          \
                 --query "string"                \
                 [--csv-input "string"]          \
                 [--compression "string"]        \
                 [--csv-output "string"]         \
                 [--csv-output-header "string"]  \
                 [--enc-c "string"]              \
                 [--json-input "string"]         \
                 [--json-output "string"]        \
                 [--recursive]                   \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The full path to the bucket or object to run the SQL query against. Specify the alias of a configured S3 service as the prefix to the ALIAS path. For example:

mc sql [FLAGS] play/mybucket
--query, e

mc-cmd

Required

The SQL statement to execute on the specified ALIAS directory or object. Wrap the entire SQL query in double quotes ".

Defaults to "select * from S3Object".

--csv-input

mc-cmd

Optional

The data format for .csv input objects. Specify a string of comma-seperated key=value,... pairs. See CSV Formatting Fields for more information on valid keys.

--compression

mc-cmd

Optional

The compression type of the input object. Specify one of the following supported values:

  • GZIP
  • BZIP2
  • NONE (default)

Compression schemes supported by MinIO backend only:

--csv-output

mc-cmd

Optional

The data format for .csv output. Specify a string of comma-seperated key=value,... pairs. See CSV Formatting Fields for more information on valid keys.

See the S3 API CSVOutput for more information.

--csv-output-header

mc-cmd

Optional

The header row of the .csv output file. Specify a string of comma-separated fields as field1,field2,....

Omit to output a .csv with no header row.

--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--json-input

mc-cmd

Optional

The data format for .json or .ndjson input objects. Specify the type of the JSON contents as type=<VALUE>. The value can be either:

See the S3 API JSONInput for more information.

--json-output

mc-cmd

Optional

The data format for the .json output. Supports the rd=value key, where rd is the RecordDelimiter for the JSON document.

Omit to use the default newline character \n.

See the S3 API JSONOutput for more information.

--recursive, r

mc-cmd

Optional

Recursively searches the specified ALIAS directory using the --query SQL statement.

Global Flags

This command supports any of the global flags.

Examples

Select all Columns in all Objects in a Bucket

Use mc sql with the --recursive and --query options to apply the query to all objects in a bucket:

mc sql --recursive --query "select * from S3Object" ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket on the MinIO deployment.

Run an Aggregation Query on an Object

Use mc sql with the --query option to query an object on an MinIO deployment:

mc sql --query "select count(s.power) from S3Object" ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the object on the MinIO deployment.

Behavior

Input Formats

mc sql supports the following input formats:

Type content-type Value
.csv text/csv
.json application/json
.parquet none

For .csv file types, use mc sql --csv-input to specify the CSV data format. See CSV Formatting Fields for more information on CSV formatting fields.

For .json file types, use mc sql --json-input to specify the JSON data format.

For .parquet file types, mc sql automatically interprets the data format.

mc sql determines the type by the file extension of the target object. For example, an object named data.json is interpreted as a JSON file.

You can query data of a supported type but a different extension if the object has the appropriate content-type. For more information, see mc cp --attr.

CSV Formatting Fields

The following table lists valid key-value pairs for use with mc sql --csv-input and mc sql --csv-output. Certain key pairs are only valid for --csv-input. See the documentation for S3 API CSVInput for more information on S3 CSV formatting.

Key

--csv-input Only

Description

rd

The character that seperates each record (row) in the input .csv file.

Corresponds to RecordDelimiter in the S3 API CSVInput.

fd

The character that seperates each field in a record. Defaults to ,.

Corresponds to FieldDelimeter in the S3 API CSVInput.

qc

The character used for escaping when the fd character is part of a value. Defaults to ".

Corresponds to QuoteCharacter in the S3 API CSVInput.

qec

The character used for escaping a quotation mark " character inside an already escaped value.

Corresponds to QuoteEscapeCharacter in the S3 API CSVInput.

fh

Yes

The content of the first line in the .csv file.

Specify one of the following supported values:

  • NONE - The first line is not a header.

  • IGNORE - Ignore the first line.

  • USE - The first line is a header.

For NONE or IGNORE, you must specify column positions _# to identify a column in the --query statement.

For USE, you can specify header values to identify a column in the --query statement.

Corresponds to FieldHeaderInfo in the S3 API CSVInput.

cc

Yes

The character used to indicate a record should be ignored. The character must appear at the beginning of the record.

Corresponds to Comment in the S3 API CSVInput.

qrd

Yes

Specify TRUE to indicate that fields may contain record delimiter values (rd).

Defaults to FALSE.

Corresponds to AllowQuotedRecordDelimiter in the S3 API CSVInput.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

131 - mc stat

Syntax

The mc stat command displays information on objects in a MinIO bucket, including object metadata. You can also use it to retrieve bucket metadata.

You can use mc stat against the local filesystem to produce similar results to the stat commandline tool.

The following command displays information on all objects in the mydata bucket on the myminio MinIO deployment:

mc stat --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] stat                      \
                 [--enc-c "value"]         \
                 [--no-list]               \
                 [--recursive]             \
                 [--rewind "string"]       \
                 [--versions]              \
                 [--version-id "string"]*  \
                 ALIAS [ALIAS ...]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

mc stat --version-id is mutually exclusive with multiple parameters. See the reference documentation for more information.

Parameters

ALIAS

mc-cmd

Required

The alias of a MinIO deployment and the full path to the object for which to retrieve detailed information. For example:

mc stat myminio/mybucket/myobject.txt

You can specify multiple objects on the same or different MinIO deployments:

mc stat myminio/mybucket/myobject.txt myminio/mybucket/myobject.txt

If specifying the path to a bucket or bucket prefix, you must include the mc stat --recursive flag:

mc stat --recursive myminio/mybucket/

For retrieving information on a file from a local filesystem, specify the full path to that file:

mc stat ~/data/myobject.txt
--enc-c

mc-cmd

Optional

Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.

The parameter accepts a key-value pair formatted as KEY=VALUE

KEY

The full path to the object as alias/bucket/path/object.ext.

You can specify only the top-level path to use a single encryption key for all operations in that path.

VALUE

Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption.

Raw Base64 encoding rejects =-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.

  • KEY - the full path to the object as alias/bucket/path/object.
  • VALUE - the 32-byte RAW Base64-encoded data key to use for encrypting object(s).

For example:

# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"

You can specify multiple encryption keys by repeating the parameter.

Specify the path to a prefix to apply encryption to all matching objects at that path:

--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
Note

Note

MinIO strongly recommends against using SSE-C encryption in production workloads. Use SSE-KMS via the --enc-kms or SSE-S3 via --enc-s3 parameters instead.

--no-list

mc-cmd

Optional

Disable all LIST operations if the target does not exist.

--recursive, r

mc-cmd

Optional

Recursively mc stat the contents of the MinIO bucket specified to ALIAS.

--rewind

mc-cmd

Optional

Directs mc stat to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

--versions

mc-cmd

Optional

Directs mc stat to operate on all object versions that exist in the bucket.

--versions requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Use --versions and --rewind together to remove all object versions which existed at a specific point in time.

--version-id, vid

mc-cmd

Optional

Directs mc stat to operate only on the specified object version.

--version-id requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Mutually exclusive with any of the following flags:

Global Flags

This command supports any of the global flags.

Examples

Display Object Details

The following example displays details of the object myfile.txt in the bucket mybucket:

mc stat myminio/mybucket/myfile.txt

The output resembles the following:

Name      : myfile.txt
Date      : 2024-07-16 15:40:02 MDT
Size      : 6.0 KiB
ETag      : 3b38f7b05a0c42acdc377e60b2a74ddf
Type      : file
Metadata  :
  Content-Type: text/plain

You can specify more than one object by adding multiple paths:

mc stat myminio/mybucket/file1.txt myminio/yourbucket/file2.txt

To display detail for all objects in a bucket, use --recursive. The following example displays details for all objects in bucket mybucket:

mc stat --recursive myminio/mybucket

The output resembles the following:

Name      : file1.txt
Date      : 2024-07-16 15:40:02 MDT
Size      : 6.0 KiB
ETag      : 3b38f7b05a0c42acdc377e60b2a74ddf
Type      : file
Metadata  :
  Content-Type: text/plain

Name      : file2.txt
Date      : 2024-07-26 10:45:19 MDT
Size      : 6.0 KiB
ETag      : 3b38f7b05a0c42acdc377e60b2a74ddf
Type      : file
Metadata  :
  Content-Type: text/plain

Display Bucket Details

The following example displays information about the bucket mybucket on the myminio MinIO deployment:

mc stat myminio/mybucket

The output resembles the following:

Name      : mybucket
Date      : 2024-07-26 10:56:43 MDT
Size      : N/A
Type      : folder

Properties:
  Versioning: Un-versioned
  Location: us-east-1
  Anonymous: Disabled
  ILM: Disabled

Usage:
      Total size: 6.0 KiB
   Objects count: 1
  Versions count: 0

Object sizes histogram:
   1 object(s) BETWEEN_1024B_AND_1_MB
   1 object(s) BETWEEN_1024_B_AND_64_KB
   0 object(s) BETWEEN_10_MB_AND_64_MB
   0 object(s) BETWEEN_128_MB_AND_512_MB
   0 object(s) BETWEEN_1_MB_AND_10_MB
   0 object(s) BETWEEN_256_KB_AND_512_KB
   0 object(s) BETWEEN_512_KB_AND_1_MB
   0 object(s) BETWEEN_64_KB_AND_256_KB
   0 object(s) BETWEEN_64_MB_AND_128_MB
   0 object(s) GREATER_THAN_512_MB
   0 object(s) LESS_THAN_1024_B

Count of Objects in a Bucket

To show the number of objects in a bucket, use --json and extract the value of objectsCount with a JSON parser:

The following example uses the jq utility:

mc stat myminio/mybucket --json | jq '.Usage.objectsCount'

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

132 - mc support

Description

The MinIO Client mc support commands provides tools for analyzing deployment health or performance and for running diagnostics. You can also upload generated health reports for further analysis by MinIO engineering.

Warning

Important

The mc support commands require an active MinIO SUBNET registration.

mc support proxy set and mc support proxy remove are exceptions, as you may need to set up a proxy to complete the deployment registration.

Subcommands

mc support includes the following subcommands:

Subcommand

Description

callhome

The mc support callhome command allows the enabling or disabling of diagnostic information from a deployment to MinIO SUBNET.

diag

The mc support diag command generates a health report for a MinIO deployment.

inspect

The mc support inspect command collects the data and metadata associated to objects at the specified path.

perf

Use the mc support perf command to review the performance of the S3 API (read/write), network IO, and storage (drive read/write).

profile

mc support profile runs a system profile for your deployment. The results of the profile can provide insight into the MinIO server process running on a given node.

proxy

Use the mc support proxy command to configure a proxy to use to communicate with MinIO SUBNET.

top

The mc support top command returns statistics for distributed MinIO deployments, similar to the output of the top command in a shell.

133 - mc tag

Description

The mc tag command adds, removes, and lists tags associated to a bucket or object.

MinIO supports adding up to 10 custom tags to an object.

Subcommands

mc tag includes the following subcommands:

Subcommand

Description

list

The mc tag list command lists all tags from a bucket or object.

remove

The mc tag remove command removes all tags from a bucket or object.

set

The mc tag set command sets one or more tags to a bucket or object.

134 - mc tree

Syntax

The mc tree command lists all prefixes inside a MinIO bucket in a tree format. The command optionally supports listing all objects inside of bucket at each prefix, including the bucket root.

You can also use mc tree against a local filesystem directory to produce similar results to the tree commandline tool.

The following command prints a complete tree of all objects at any depth in the mydata bucket on the myminio MinIO deployment:

mc tree --files myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] tree                 \
                 [--depth int]        \
                 [--files]            \
                 [--rewind "string"]  \
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The alias of a MinIO deployment and the full path to the bucket to list the tree hierarchy. For example:

mc tree myminio/mybucket

You can specify multiple targets to the mc tree command. For example:

mc tree myminio/mybucket myminio/myotherbucket

For retrieving the tree heirarchy of a local filesystem directory, specify the full path to that directory. For example:

mc tree ~/minio/mydata/
--depth, d

mc-cmd

Optional Limit the tree depth to the specified integer value.

Defaults to -1 or unlimited depth.

--files, f

mc-cmd

Optional Includes files in the object or directory in the mc tree output.

--rewind

mc-cmd

Optional

Directs mc tree to operate only on the object version(s) that existed at specified point-in-time.

  • To rewind to a specific date in the past, specify the date as an ISO8601-formatted timestamp. For example: --rewind "2020.03.24T10:00".
  • To rewind a duration in time, specify the duration as a string in #d#hh#mm#ss format. For example: --rewind "1d2hh3mm4ss".

--rewind requires that the specified ALIAS be an S3-compatible service that supports Bucket Versioning. For MinIO deployments, use mc version to enable or disable bucket versioning.

Examples

mc tree ALIAS/PATH
  • Replace ALIAS with the alias of the MinIO deployment.
  • Replace PATH with the path to the bucket on the MinIO deployment.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

135 - mc undo

Syntax

The mc undo command reverses changes due to either a PUT or DELETE operation at a specified path.

The following command reverts the last three uploads and/or deletions of the file.zip object on the myminio deployment in the data bucket:

mc undo myminio/data/file.zip --last 3

The command has the following syntax:

mc [GLOBALFLAGS] undo                \
                 TARGET              \
                 [--action "type"]   \
                 [--force]           \
                 [--last "integer"]  \
                 [--recursive, r]    \
                 [--dry-run]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

TARGET

mc-cmd

Required

The full path to the object or prefix where the command should run. The path must include the ALIAS, bucket, and prefix or object name.

--action

mc-cmd

Optional

Undo the most recent change of the specified type. Accepted values are DELETE or PUT.

By default, mc undo reverses both DELETE and PUT operations. Use --action to choose one or the other, but only for the most recent operation of the specified type.

The following command reverts the most recent PUT for the object today.zip in bucket data, reverting to the previous object version:

mc undo myminio/data/today.zip --action "PUT"

This example reverts the most recent DELETE for the prefix archive, recursively restoring it and any child objects:

mc undo myminio/data/archive --recursive --action "DELETE"

Mutually exclusive with --last.

--dry-run

mc-cmd

Optional

Output the results of the command without actually performing the operations. Use this flag to test the outcome of running the command in a particular way.

--force

mc-cmd

Optional

Force a recursive operation.

--last

mc-cmd

Optional

Accepts an integer value specifying the number of PUT and/or DELETE changes to undo.

If not specified, the command reverses one (1) operation. Mutually exclusive with --action.

--recursive, r

mc-cmd

Optional

Performs the command in a recursive fashion. Use this flag to undo changes on a prefix, for example.

Global Flags

This command supports any of the global flags.

Examples

Undo the Last Three Uploads or Deletions on an Object

The following command reverts the last three uploads and/or deletions of the file.zip object on the myminio deployment in the data bucket:

mc undo myminio/data/file.zip --last 3

Undo the Last Upload or Deletion of any Object at a Prefix

Use mc undo to reverse the most recent PUT or DELETE operation performed on the myminio alias in the data bucket under the presentations/recordings/ prefix:

mc undo myminio/data/presentations/recordings/ --recursive --force

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

136 - mc update

Syntax

The Pigsty-maintained client keeps mc update for command-line compatibility, but self-update is intentionally disabled. The command does not contact a release feed, download a binary, or replace the installed mc/mcli executable. It prints an error and exits with status 1.

Upgrade through Download & Install, the Pigsty package repository, or GitHub Releases.

The following command reports that self-update is disabled and exits with status 1:

mc update

The command has the following syntax:

mc [GLOBALFLAGS] update [--json] [RELEASE-URL]
  • Brackets [] indicate optional parameters.
  • RELEASE-URL is accepted only for compatibility and is not contacted.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

The non-JSON error text is:

Self-update is disabled in the Pigsty mc fork; upgrade only through the Pigsty package repository or https://github.com/pgsty/mc/releases.

Global Flags

--json

mc-cmd

Optional

Formats the disabled-update error as one JSON Lines object. This flag does not enable updating.

For example:

mc update --json

137 - mc version

Description

The mc version commands enable, disable, and retrieve the versioning status for a MinIO bucket.

For more information about object versioning in MinIO, see Bucket Versioning.

mc version includes the following subcommands:

Subcommand

Description

enable

The mc version enable command enables versioning on the specified bucket.

info

The mc version info command returns the versioning status for the specified bucket.

suspend

The mc version suspend command disables versioning on the specified bucket.

Behavior

Object Locking Enables Bucket Versioning

While bucket versioning is disabled by default, configuring object locking on a bucket or an object in that bucket automatically enables versioning for the bucket. See mc retention for more information on configuring object locking.

Bucket Versioning with Existing Data

Enabling bucket versioning on a bucket with existing data immediately creates a null value version ID for each unversioned object.

Disabling bucket versioning on a bucket with existing versioned data does not remove any versioned objects. Applications can continue to access versioned data after disabling bucket versioning. Use mc rm --versions ALIAS/BUCKET/OBJECT to delete an object and all its versions.

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

138 - mc watch

Syntax

The mc watch command watches for events on the specified MinIO bucket or local filesystem path. For S3 services, use mc event add to configure bucket event notifications on S3-compatible services.

You can also use mc watch against a local filesystem directory to produce similar results to running the inotify -e modify,create,delete,move command.

The following command watches for events on any object or prefix in the mydata bucket on the myminio MinIO deployment:

mc watch --recursive myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] watch                \
                 [--event "string"]   \
                 [--prefix "string"]  \
                 [--recursive]        \
                 [--suffix "string"]  \
                 ALIAS
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required The alias of a MinIO deployment and the full path to the bucket to watch for configured events. For example:

mc watch myminio/mybucket
--event

mc-cmd

The event(s) to watch for. Specify multiple events using a comma , delimiter. See Supported Bucket Events for supported events.

Defaults to put,delete, get.

--prefix

mc-cmd

The bucket prefix in which to watch for the specified --event.

For example, given a ALIAS of play/mybucket and a --prefix of photos, only events in play/mybucket/photos trigger bucket notifications.

--recursive, r

mc-cmd

Recursively watch for events in the specified ALIAS bucket path or local directory.

--suffix

mc-cmd

The bucket suffix in which to watch for the specified --event.

For example, given a ALIAS of play/mybucket and a --suffix of .jpg, only events in play/mybucket/*.jpg trigger bucket notifications.

Global Flags

--json

mc-cmd

Optional

Enables JSON lines formatted output to the console.

For example:

mc --json COMMAND

Examples

Watch for Events in a Bucket

mc watch --recursive ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

139 - mc idp ldap accesskey create

Note

Added: mc

RELEASE.2023-12-23T08-47-21Z

Description

The mc idp ldap accesskey create allows you to add LDAP access key pairs.

The following example creates a new access key pair with the same policy as the authenticated user on the minio alias:

mc idp ldap accesskey create minio/

The command has the following syntax:

mc [GLOBALFLAGS] idp ldap accesskey create                   \
                                 ALIAS                       \
                                 [--access-key <value>]      \
                                 [--secret-key <value>]      \
                                 [--policy <value>]          \
                                 [--name <value>]            \
                                 [--description <value>]     \
                                 [--expiry <value>]          \
                                 [--expiry-duration <value>]
  • Replace ALIAS with the alias of a MinIO deployment configured for AD/LDAP integration.

  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

mc-cmd

Required

The alias of the MinIO deployment configured for AD/LDAP.

For example:

mc idp ldap accesskey create minio
--access-key

mc-cmd

Optional

An access key to use for the account. The access key cannot contain the characters = (equal sign) or , (comma).

Requires --secret-key

--secret-key

mc-cmd

Optional

A secret to use for the account.

Requires --access-key

--policy

mc-cmd

Optional

File path to the JSON-formatted policy to use for the account.

If not specified, the account uses the same policy as the authenticated user.

--name

mc-cmd

Optional

A human-readable name to use for the account.

--description

mc-cmd

Optional

Add a description for the service account. For example, you might specify the reason the access key exists.

--expiry-duration

mc-cmd

Optional

Length of time the access key pair should remain valid for use in #d#h#s format.

For example, 7d, 24h, 5d12h30s are valid strings.

Mutually exclusive with --expiry.

--expiry

mc-cmd

Optional

The date after which the access key expires. Enter the date in YYYY-MM-DD format.

For example, to expire the credentials after December 31, 2024, enter 2024-12-31.

Mutually exclusive with --expiry-duration.

--login

mc-cmd

Optional

Caution

Deprecated: RELEASE.2024-04-18T16-45-29Z

Use mc idp ldap accesskey create-with-login to access the functionality previously provided by this parameter.

Prompts the user to log in using the LDAP credentials to use to generate the access key. Specify the URL of the LDAP-configured MinIO Server to use for the login prompt.

Requires an interactive terminal.

Global Flags

This command supports any of the global flags.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.

Examples

Create a new access-key pair for the authenticated user

The following command creates a new access key pair to use with the currently authenticated user on the minio alias. The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create minio

Create a new access-key pair with a custom access key and secret key

The following command creates a new access key pair with both an access key and secret key that you specify for the user currently authenticated on the minio alias.

mc idp ldap accesskey create minio/ --access-key my-access-key-change-me --secret-key my-secret-key-change-me

Create a new access-key pair that expires after 24 hours

The following command creates a new access key pair to use with the currently authenticated user on the minio alias. The credentials expire after 24 hours.

The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create minio --expiry-duration 24h

Create a new access-key and prompt to login as the user

The following command creates a new access key pair. The MinIO Client will first ask you to log in as the user the access key is for on the MinIO site configured for LDAP at minio.example.com.

The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create minio --login minio.example.com

Create a new access-key pair that expires after a date

The following command creates a new access key pair to use with the currently authenticated user on the minio alias. The credentials expire after February 29, 2024.

The command outputs a randomly generated access key and secret key.

mc idp ldap accesskey create minio --expiry 2024-02-29