This is the multi-page printable view of this section. .
Silo Client (mcli / mc)
- 1: mc alias list
- 2: mc anonymous set
- 3: mc batch cancel
- 4: mc encrypt clear
- 5: mc event add
- 6: mc idp ldap accesskey disable
- 7: mc idp ldap add
- 8: mc idp ldap policy attach
- 9: mc ilm restore
- 10: mc ilm rule add
- 11: mc ilm tier add
- 12: mc legalhold clear
- 13: mc license info
- 14: mc replicate add
- 15: mc retention set
- 16: mc share download
- 17: mc support callhome
- 18: mc support top api
- 19: mc tag set
- 20: mc version enable
- 21: Silo Client Settings
-
22: mc alias
- 23: mc alias remove
- 24: mc anonymous get
- 25: mc batch describe
- 26: mc encrypt info
- 27: mc event ls
- 28: mc idp ldap accesskey edit
- 29: mc idp ldap disable
- 30: mc idp ldap policy detach
-
31: mc ilm rule
- 32: mc ilm rule edit
- 33: mc ilm tier check
- 34: mc legalhold info
- 35: mc license register
- 36: mc replicate backlog
- 37: mc retention info
- 38: mc share upload
- 39: mc support diag
- 40: mc support top locks
- 41: mc tag list
- 42: mc version info
- 43: mc alias set
-
44: mc anonymous
- 45: mc anonymous list
- 46: mc batch generate
- 47: mc encrypt set
- 48: mc event rm
- 49: mc idp ldap accesskey enable
- 50: mc idp ldap enable
- 51: mc idp ldap policy entities
- 52: mc ilm rule export
-
53: mc ilm tier
- 54: mc ilm tier info
- 55: mc legalhold set
- 56: mc license update
- 57: mc replicate ls
- 58: mc retention clear
- 59: mc share ls
- 60: mc support inspect
- 61: mc support top disk
- 62: mc tag remove
- 63: mc version suspend
- 64: mc alias import
- 65: mc anonymous links
-
66: mc batch
- 67: mc batch list
- 68: mc idp ldap accesskey info
- 69: mc idp ldap info
- 70: mc ilm rule import
- 71: mc ilm tier ls
- 72: mc replicate update
- 73: mc support perf
- 74: mc support top net
- 75: mc alias export
- 76: mc anonymous get-json
- 77: mc batch start
- 78: mc cat
- 79: mc idp ldap accesskey ls
- 80: mc idp ldap ls
- 81: mc ilm rule ls
- 82: mc ilm tier rm
- 83: mc replicate resync
- 84: mc support profile
- 85: mc support top rpc
- 86: mc anonymous set-json
- 87: mc batch status
- 88: mc cp
- 89: mc idp ldap accesskey rm
- 90: mc idp ldap rm
- 91: mc ilm rule rm
- 92: mc ilm tier update
- 93: mc replicate rm
- 94: mc support proxy
- 95: mc diff
- 96: mc idp ldap update
- 97: mc replicate status
-
98: mc support top
- 99: mc du
- 100: mc replicate export
- 101: mc support upload
-
102: mc encrypt
- 103: mc replicate import
-
104: mc event
- 105: mc find
- 106: mc get
- 107: mc head
-
108: mc idp ldap
-
109: mc idp ldap accesskey
- 110: mc idp ldap accesskey create-with-login
-
111: mc idp ldap policy
- 112: mc idp openid
-
113: mc ilm
-
114: mc legalhold
-
115: mc license
- 116: mc ls
- 117: mc mb
- 118: mc mirror
- 119: mc mv
- 120: mc od
- 121: mc ping
- 122: mc pipe
- 123: mc put
- 124: mc rb
- 125: mc ready
-
126: mc replicate
-
127: mc retention
- 128: mc rm
-
129: mc share
- 130: mc sql
- 131: mc stat
-
132: mc support
-
133: mc tag
- 134: mc tree
- 135: mc undo
- 136: mc update
-
137: mc version
- 138: mc watch
- 139: mc idp ldap accesskey create
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:
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:
mc update is intentionally disabled in the Pigsty fork. Upgrade through the Silo download page, the Pigsty package repository, or GitHub Releases.
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
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.
- Replace
ALIASwith a name to associate to the S3 service.mccommands typically requireALIASas an argument for identifying which S3 service to execute against. - Replace
HOSTNAMEwith the URL endpoint or IP address of the S3 service. - Replace
ACCESS_KEYandSECRET_KEYwith 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:
3) Test the Connection
Use the mc admin info command to test the connection to the newly added Silo deployment:
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
pingortraceroute). -
The specified
ACCESSKEYandSECRETKEYcorrespond 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
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 listmc alias removemc alias setmc alias importmc alias export |
The |
mc anonymous getmc anonymous get-jsonmc anonymous linksmc anonymous listmc anonymous setmc anonymous set-json |
The |
mc batch describemc batch generatemc batch listmc batch startmc batch status |
The |
The |
|
The |
|
The |
|
The |
|
mc encrypt clearmc encrypt infomc encrypt set |
The |
mc event addmc event lsmc event rm |
The |
The |
|
The |
|
The |
|
mc idp ldap accesskeymc idp ldap accesskey create-with-loginmc idp ldap addmc idp ldap disablemc idp ldap enablemc idp ldap infomc idp ldap lsmc idp ldap policymc idp ldap rmmc idp ldap update |
The |
mc idp openid addmc idp openid disablemc idp openid enablemc idp openid infomc idp openid lsmc idp openid rmmc idp openid update |
The |
mc idp ldap policy attachmc idp ldap policy detachmc idp ldap policy entities |
The |
mc ilm restoremc ilm rule addmc ilm rule editmc ilm rule exportmc ilm rule importmc ilm rule lsmc ilm rule rmmc ilm tier addmc ilm tier checkmc ilm tier infomc ilm tier lsmc ilm tier rmmc ilm tier update |
The |
mc legalhold clearmc legalhold infomc legalhold set |
The |
mc license infomc license registermc license update |
The |
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The To remove only the contents of a bucket, use |
|
The |
|
mc replicate addmc replicate backlogmc replicate exportmc replicate importmc replicate lsmc replicate resyncmc replicate rmmc replicate statusmc replicate update |
The |
mc retention clearmc retention infomc retention set |
The |
The |
|
mc share downloadmc share lsmc share upload |
Use the |
The |
|
The |
|
mc support callhomemc support diagmc support inspectmc support perfmc support profilemc support proxymc support top apimc support top diskmc support top locksmc support upload |
The MinIO Client |
mc tag listmc tag removemc tag set |
The |
The |
|
The |
|
The |
|
mc version enablemc version infomc version suspend |
The |
The |
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:
HOME\.mc\config.jsonUSERPROFILE\.mc\config.jsonHOMEDRIVE+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:
Windows systems:
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
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:
Alternatively, set the environment variable MC_DEBUG.
--disable-pager --dp
option
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:
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
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:
For example:
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:
The mc alias list command has the following syntax:
- 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.
List a Specific Alias
The following mc alias list command lists the details of a specific alias in the local mc configuration.
- Replace
ALIASwith 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:
Applications can perform the following operations without authentication:
PUTobjects tomyminio/uploadsandmyminio/public.GETobjects frommyminio/downloadsandmyminio/public.
The command has the following syntax:
- 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 theALIAS.download- Enable download-only access to theALIAS.upload- Enable upload-only access to theALIAS.public- Enable download and upload access to theALIAS.
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:
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:
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:
- Replace
POLICYwith a supportedpermission. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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
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.
The command has the following syntax:
- 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:
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:
The command has the following syntax:
- 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:
Global Flags
This command supports any of the global flags.
Examples
Remove the Automatic Server-Side Encryption Settings for a Bucket
- Replace
ALIASwith 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:
The specified ARN corresponds to a configured bucket notification target on the myminio deployment.
The command has the following syntax:
- 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:
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:
putgetdelete
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:
Behavior
Supported Bucket Events
The following table lists the supported mc event add values and their corresponding S3 events:
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
mykeyon theminiodeployment:
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment configured for AD/LDAP integration. -
Replace
KEYwith 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:
KEY
mc-cmd
Required
The configured access key to disable.
Example
Disable the access key mykey from the minio 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.
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.
The command has the following syntax:
-
Replace
ALIASwith 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 ofPARAMETER="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:
server_addr
mc-cmd
Required
Specify the hostname for the Active Directory / LDAP server. For example:
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.
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
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.
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:
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:
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:
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:
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
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:
For SRV record names with beginning with _ldaps, specify ldaps. The constructed DNS SRV record name resembles the following:
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.
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
userpolicyto the userbobfisheron themyminiodeployment:
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment to configure for AD/LDAP integration. -
Replace
POLICYNAMEwith the policy to attach to the entity. You may list multiple policies to attach to the entity. -
Use must use one of either the
--useror--groupflag. 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:
Example
The following example attaches two policies, policy1 and policy2, to the projectb group on the myminio 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.
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.
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:
The command has the following syntax:
- 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.
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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:
Restore a Specific Archived Object Version
The following command restore a specific object version archived to a remote tier:
Restore All Archived Objects at a Bucket Prefix
The following command restores all objects archived under a specified prefix on the remote tier:
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
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:
The configured rules have the following effect:
- Delete objects more than 90 days old
- Delete objects 30 days after they become non-current
- Delete
DeleteMarkertombstones if that object has no other versions remaining. - Transition objects more than 30 days old to the
COLDTIERremote tier. - Transition objects 7 days after they become non-current to the
COLDTIERremote tier.
The command has the following syntax:
- 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:
--prefix
mc-cmd
Optional
Restrict the management rule to a specific object prefix.
For example:
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
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.
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
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
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the bucket on the S3-compatible host. - Replace
DAYSwith the number of days after which to expire each object. For example, specify30to 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.
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-1storage tier. - Non-current objects in the prefix older than 45 days move to the
MINIOTIER-2storage tier. - Both
MINIOTIER-1andMINIOTIER-2have already been created withmc 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.
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.
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.
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the bucket on the S3-compatible host.
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
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:
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.
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:
^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:
|
Use a remote MinIO deployment as the storage backend for the new Tier. Requires also specifying the following parameters: |
|
Use AWS S3 as the storage backend for the new Tier. Requires also specifying the following parameters: |
|
Use Azure Blob Storage as the storage backend for the new Tier. Requires also specifying the following parameters: |
|
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:
STANDARDRecommendedREDUCED
For more information, see Erasure Coding storage class.
STANDARDSTANDARD-IAONEZONE-IA
For more information, see Using Amazon S3 storage classes.
STANDARDNEARLINECOLDLINE
For more information, see GCS storage class.
HotCool
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.
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
mybucketbucket and themyprefixprefix 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.
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
myazurebucketbucket and themyazureprefixprefix 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.
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
mygcsbucketbucket and themygcsprefixprefix 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.
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
mys3bucketbucket and themys3prefixprefix on the GCS storage. - The tier utilizes S3
STANDARDstorage class located in theus-west-2S3 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:
The command has the following syntax:
- 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:
--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#ssformat. 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
Retrieve the Legal Hold Status Objects
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:
- Replace
ALIASwith the alias of the S3-compatible host. - Replace
PATHwith the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the--recursiveoption.
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:
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
If a deployment uses an expired MinIO Commercial License, the command outputs an error message.
Syntax
The command has the following syntax:
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
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
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:
The replication rule synchronizes versioned delete operations, delete markers, and existing objects to the remote MinIO deployment.
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:
- 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:
--remote-bucket
mc-cmd
Required
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:
An alias based target might look like the following:
--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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit bandwidth rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit download rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit upload rates to no more than 1 GiB/s, use the following:
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 bucketoff- use a resource locator style (such as a domain or IP address) lookup to find the remote bucketauto- 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:
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:
- Replace
myminio/mybucketwith theALIASand full bucket path for which to create the replication configuration. - Replace the
--remote-bucketvalue with the URL or path of the remote target. If using a file path format location, use the--path onoption. - The
--replicateflag 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:
- Replace
myminio/mybucketwith theALIASand full bucket path for which to create the replication configuration. - Replace the
--remote-bucketvalue with the location of the remote target. If using a file path format location, use the--path onoption. - The
--replicateflag 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:
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith 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.
- 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.
- 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 theResourcearray 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 theResourcearray 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 tomc replicate add --replicate. - To enable replication of existing objects for an existing replication rule, add
"existing-objects"to the list of existing replication features usingmc 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:
The command has the following syntax:
- 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:
governancecompliance
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,30dfor 30 days after object creation. -
For years, specify a string formatted as
Ny. For example,1yfor 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:
- If the
ALIASspecifies a bucket or bucket prefix, include--recursiveto apply the object lock settings to the bucket contents. mc retention setby default applies to only the latest object version. Use--version-idor--versionsto 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#ssformat. 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.
- Replace
MODEwith the retention mode to enable. MinIO supports the AWS S3 retention modesgovernanceandcompliance. - Replace
DURATIONwith the duration which the object lock should remain in effect. For example, to set a retention period of 30 days, specify30d. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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-lockfor 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:
- Replace
VERSIONwith the version of the object. - Replace
MODEwith the retention mode to enable. MinIO supports the AWS S3 retention modesgovernanceandcompliance. - Replace
DURATIONwith the duration which the object lock should remain in effect. For example, to set a retention period of 30 days, specify30d. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith the path to the object.
Use mc retention set with --versions to apply the retention settings to a specific object version:
- Replace
MODEwith the retention mode to enable. MinIO supports the AWS S3 retention modesgovernanceandcompliance. - Replace
DURATIONwith the duration which the object lock should remain in effect. For example, to set a retention period of 30 days, specify30d. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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-lockfor 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:
Interaction with Legal Holds
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
GETto 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:
The command has the following syntax:
- 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:
You can specify multiple objects on the same or different MinIO deployments. For example:
If specifying the path to a bucket or bucket prefix, you must also specify the --recursive argument. For example:
--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:
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:
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.
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.
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.
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.
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
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.
Disable callhome reporting
Disable sending diagnostic information to SUBNET for a deployment registered to SUBNET with an alias of minio1.
Display Current callhome settings
Display whether a deployment with the alias minio1 sends information to SUBNET.
Global Flags
This command supports any of the global flags.
18 - mc support top api
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.
The command has the following syntax:
- 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:
Display Current, In-progress s3.PutObject Calls
The following command displays all in-progress s3.PutObject calls for the myminio deployment:
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:
The command has the following syntax:
- 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:
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:
--exclude-folders
mc-cmd
Optional
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.
--recursive, r
mc-cmd
Optional
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#ssformat. 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:
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith the path to the bucket or object on the MinIO deployment. - Replace
TAGSwith 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:
The command has the following syntax:
- 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:
--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:
Global Flags
This command supports any of the global flags.
Example
Enable Bucket Versioning
Use mc version enable to enable versioning for a bucket:
- Replace
ALIASwith thealiasof a configured MinIO deployment. - Replace
PATHwith 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.
This setting does not have a configuration setting option.
Use mc alias set to configure an alias.
Examples
Static Credentials
Security Token Service (STS) Credentials
STS Service
Added: mc
RELEASE.2023-11-06T04-19-23Z
Use this setting to add an STS endpoint to use for mc commands.
Changed: mc
RELEASE.2023-12-02T02-03-28Z
Supports adding multiple environment variables by alias.
Web Token Identity
Added: mc
RELEASE.2023-11-06T04-19-23Z
Use this setting to add a web token identity to use for mc commands.
Changed: mc
RELEASE.2023-12-02T02-03-28Z
Supports adding multiple environment variables by alias.
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
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:
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:
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.
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.
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 |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
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:
The mc alias remove command has the following syntax:
- 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.
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:
The command has the following syntax:
- 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:
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:
- Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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
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.
The command has the following syntax:
- 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:
- Replace
myminiowith thealiasof the MinIO deployment that should run the job. - Replace
KwSysDpxcBU9FNhGkn2dCfwith the ID of the job to define.
The output of the above command is similar to the following:
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.
The command has the following syntax:
- 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:
Global Flags
This command supports any of the global flags.
Examples
Retrieve the Automatic Server-Side Encryption Settings for a Bucket
- Replace
ALIASwith 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:
The command has the following syntax:
- 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 S3 service alias and bucket to which the command lists event notification. For example:
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.
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
mykeyon theminiodeployment:
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment configured for AD/LDAP integration. -
Replace
KEYwith 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:
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.
Modify the expiration duration for an accesskey
Modify the expiration duration for the access key mykey on the minio 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.
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.
The command has the following syntax:
-
Replace
ALIASwith 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:
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.
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment to configure for AD/LDAP integration. -
Replace
POLICYNAMEwith the policy to detach from the entity. You may list multiple policies to detach from the entity. -
Use must use one of either the
--useror--groupflag. 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:
Example
The following example detaches two policies, policy1 and policy2, from the projectb group on the myminio 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.
31 - mc ilm rule
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 |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
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:.
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:
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
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:
The command modifies the specified rules as follows:
- Delete objects more than 90 days old.
- Delete
DeleteMarkertombstones if that object has no other versions remaining. - Transition objects more than 30 days old to the
COLDTIERremote tier.
The command has the following syntax:
- 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:
--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:
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
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.
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the bucket on the S3-compatible host. - Replace
RULEIDwith the unique ID of the object lifecycle management rule. Usemc ilm rule lsto find theRULEID. - Specify any additional flags to add or modify the lifecycle management rule. For example, specify
--transition-daysto 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.
- Replace
RULEIDwith the unique ID of the object lifecycle management rule. Usemc ilm rule lsto find theRULEID. - Replace
myminiowith the ALIAS of the deployment where the rule exists. - Replace
mybucketwith 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.
The command has the following syntax:
- 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.
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:
The command has the following syntax:
- 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:
--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#ssformat. 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
Retrieve the Legal Hold Status Objects
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:
- Replace
ALIASwith the alias of the S3-compatible host. - Replace
PATHwith the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the--recursiveoption.
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
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
minioalias with MinIO SUBNET:
The command has the following syntax:
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:
- Log in to MinIO SUBNET
- Go to the Deployments tab
- Select the API Key button near the top of the page on the right side of the account statistics information box
- 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.
- Log in to MinIO SUBNET
- Go to the Deployments tab
- Select the License button near the top of the page on the right side of the account statistics information box
- 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:
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:
If not already downloaded, you can download the license file from SUBNET.
- Log in to MinIO SUBNET
- Go to the Deployments tab
- Select the License button near the top of the page on the right side of the account statistics information box
- 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:
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.
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.
-
Run the command to return a registration link with token
-
Open the copied registration link in a web browser and sign in to SUBNET
-
Select the ? button to the right of the License number for the deployment
-
In the popup, select the download link and save the key to a path you have access to
-
In the command line, run the following command
Replace
<path-to-file>with the path to the file you downloaded from SUBNET.
Syntax
The command has the following syntax:
Global Flags
This command supports any of the global flags.
Behavior
Automatic License Updates
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
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.
If any new or deleted objects have not yet replicated, the command outputs something similar to the following:
In the output, PUT corresponds to a new object. Deleted objects or versions would show DEL.
The command has the following syntax:
- 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:
- Replace
myminio/mybucketwith theALIASand full bucket path for which to create the replication configuration. - Replace
path/to/prefixwith 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:
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:
- Replace
myminio/mybucketwith theALIASand full bucket path for which to show unreplicated objects. - Replace the
path/to/prefixwith 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:
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:
The command has the following syntax:
- 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:
-
If the
ALIASspecifies a bucket or bucket prefix, include--recursiveto return the object lock settings for all objects in the bucket or bucket prefix. -
If the
ALIASbucket has versioning enabled,mc retention infoby default applies to only the latest object version. Use--version-idor--versionsto 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#ssformat. 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)
Use mc retention info with --recursive to retrieve the retention settings for all objects in a 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-lockfor 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:
-
Replace
ALIASwith thealiasof a configured S3-compatible host. -
Replace
PATHwith 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-lockfor 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:
The command has the following syntax:
- 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:
You can specify multiple objects on the same or different MinIO deployments. For example:
If specifying the path to a bucket or bucket prefix, you must also specify the --recursive argument. For example:
--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:
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:
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:
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith the path to the bucket or bucket prefix on the MinIO deployment. - Replace
DURATIONwith the duration after which the URL expires. For example, to set a 30 day expiry, specify30d.
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:
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
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.
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
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.
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:
- Run the command to download the
.gzipfile - Login to https://subnet.min.io and select the Deployments section
- Select the deployment for the report
- Select the Upload button
- Drag and drop the file or browse to the
.gzipfile 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.
Syntax
The command has the following syntax:
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
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.
--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
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:
The following command displays the current in-progress S3 API calls on the alias myminio.
The command has the following syntax:
- 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
Display Stale Locks on the myminio Deployment
The following command displays all in-progress s3.PutObject calls for the myminio deployment:
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:
The command has the following syntax:
- 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:
--recursive, r
mc-cmd
Optional
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#ssformat. 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:
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith 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:
The command has the following syntax:
- 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:
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:
- Replace
ALIASwith thealiasof a configured MinIO deployment. - Replace
PATHwith 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:
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:
- 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.
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:
myminioTest-1Aa
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
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.
If the myminio alias already exists, the mc alias set command overwrites that alias with the specified arguments.
- Replace
ALIASwith the name to associate with the MinIO service. - Replace
HOSTNAMEwith 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
ACCESSKEYandSECRETKEYwith 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 |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
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:
The command has the following syntax:
- 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:
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:
- Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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
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.
The command has the following syntax:
- 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:
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:
-
Replace
aliaswith thealiasto use to generate the yaml file. -
Replace
replicatewith the type of job to generate a yaml file for.:mc:
mc batchsupports thereplicateandkeyrotatejob 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 objects between two MinIO deployments. Provides similar functionality to bucket replication as a batch job rather than continual scanning function.
-
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.
-
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:
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:
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:
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:
The command has the following syntax:
- 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 inKMSKEY. 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 toMINIO_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:
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.
- Replace
ENCRYPTIONwithsse-kmsorsse-s3depending on the preferred encryption mode. - Replace
KMSKEYwith the name of the encryption key on the configured root KMS. This argument has no effect withsse-s3. - Replace
TARGETwith 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:
The command has the following syntax:
- 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 S3 service alias and bucket from which the command removes the event notification. For example:
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:
Use the following command to remove the event:
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:
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
mykeyfrom theminiodeployment:
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment configured for AD/LDAP integration. -
Replace
KEYwith 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:
KEY
mc-cmd
Required
The configured access key to enable.
Example
Enable the access key mykey from the minio 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.
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.
The command has the following syntax:
-
Replace
ALIASwith 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:
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-policypolicy. - Policies assigned to the
uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=iouser. - Policies assigned to the
cn=projectb,ou=groups,ou=swengg,dc=min,dc=iogroup.
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment to configure for AD/LDAP integration. -
You may use each of the
--user,--group, and/or--policyflags 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:
--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:
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
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:
The command has the following syntax:
- 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:
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:
-
Replace
ALIASwith the alias of the MinIO deployment and the bucket for which to export object lifecycle management rules:myminio/mydata -
Replace
file.jsonwith 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
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 |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
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:
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:
Modify the Resource for the bucket into which MinIO tiers objects.
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:.
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.
The command has the following syntax:
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.
Display the Statistics for all Existing Tiers on a Deployment
The following example displays the statistics of all existing tiers on the myminio deployment.
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:
The command has the following syntax:
- 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:
--recursive, r
mc-cmd
Optional
Applies the legal hold to all existing objects in the ALIAS bucket or bucket prefix.
--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#ssformat. 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:
- Replace
ALIASwith the alias of the S3-compatible host. - Replace
PATHwith the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the--recursiveoption.
Behavior
Legal Holds Require Explicit Removal
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 Complement Other Retention Modes
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
Syntax
The command has the following syntax:
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:
- Log in to MinIO SUBNET
- Go to the Deployments tab
- Select the API Key button near the top of the page on the right side of the account statistics information box
- 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
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:
The command has the following syntax:
- 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:
--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:
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith 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:
The command has the following syntax:
- 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:
-
If the
ALIASspecifies a bucket or bucket prefix, include--recursiveto clear the object lock settings to the bucket contents. -
If the
ALIASbucket has versioning enabled,mc retention clearby default applies to only the latest object version. Use--version-idor--versionsto 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#ssformat. 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)
Use mc retention clear with --recursive to clear the retention settings from all objects in a 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-lockfor 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:
The command has the following syntax:
- 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:
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:
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
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.
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.
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.
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.
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.
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.
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
This can be an expensive operation. Proceed with caution.
Syntax
The command has the following syntax:
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
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.
The command has the following syntax:
- 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:
The command has the following syntax:
- 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:
--recursive, r
mc-cmd
Optional
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#ssformat. 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:
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith 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:
The command has the following syntax:
- 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:
Global Flags
This command supports any of the global flags.
Example
Disable Bucket Versioning
Use mc version suspend to disable versioning for a bucket:
- Replace
ALIASwith thealiasof a configured MinIO deployment. - Replace
PATHwith 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:
Use mc alias list newalias to confirm the import succeeded.
The mc alias import command has the following syntax:
- 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:
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:
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:
The command has the following syntax:
- 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:
--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:
- Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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
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 |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
67 - mc batch list
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.
The command has the following syntax:
- 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:
-
Replace
myminiowith thealiasof the MinIO deployment that should run the job. -
Replace
replicatewith the job type to output.Currently,
mc batchonly supports thereplicatejob type.
The output of the above command is similar to the following:
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
mykeyfrom theminiodeployment:
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment configured for AD/LDAP integration. -
Replace
KEYwith 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:
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.
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.
The command has the following syntax:
-
Replace
ALIASwith 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:
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
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:
The command has the following syntax:
- 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:
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:
-
Replace
ALIASwith the alias of the MinIO deployment and the bucket into which to import object lifecycle management rules:myminio/mydata -
Replace
file.jsonwith 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
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.
The command has the following syntax:
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
Changed: RELEASE.2022-12-24T15-21-38Z
mc replicate update replaces the mc admin bucket remote update command.
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.
The following command modifies an existing replication rule for the mydata bucket on the myminio MinIO deployment:
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:
- 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:
--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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit bandwidth rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit download rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit upload rates to no more than 1 GiB/s, use the following:
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 bucketoff- use a resource locator style (such as a domain or IP address) lookup to find the remote bucketauto- 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:
An alias based target might look like the following:
--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:
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.
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith the path to the bucket or bucket prefix on which the rule exists. - Replace
IDwith the unique identifier for the rule to modify. Usemc replicate lsto retrieve the list of replication rules on the bucket and their corresponding identifiers.
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.
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith the path to the bucket or bucket prefix on which the rule exists. - Replace
IDwith 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.
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith the path to the bucket or bucket prefix on which the rule exists. - Replace
IDwith the unique identifier for the rule to modify. Usemc replicate lsto retrieve the list of replication rules on the bucket and their corresponding identifiers. - Specify either
"disable"or"enable"to the--stateflag to disable or enable the replication rule.
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.
- 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.
- 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 theResourcearray 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 theResourcearray 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
Changed: RELEASE.2022-07-24T02-25-13Z
mc support perf replaces the mc admin speedtest command.
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
-
Measure the speed of drives in a MinIO deployment.
mc support perf drivetemporarily 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. -
Measure the speed of reading and writing objects in a cluster.
-
Measure the network throughput of all nodes.
mc support perf nettemporarily 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. -
Measure the network throughput to a client.
-
Measure the speed of site replication operations.
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).
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.
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.
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.
Test Network Throughput
Run a network throughput test on a cluster with alias minio1.
Test Site Replication Speed
Run a test on the speed of site replication operations from the minio1 site to other configured peers.
Syntax
mc support perf drive
mc-cmd
Measure the read/write speed of the drives in a cluster.
mc support perf object
mc-cmd
Measure the S3 performance of reading and writing objects in a cluster.
mc support perf net
mc-cmd
Measure the network throughput of all nodes in a cluster.
mc support perf client
mc-cmd
Measure the network throughput from the local device running the MinIO Client to the server.
mc support perf site-replication
mc-cmd
Measure the speed of site replication operations from the specified ALIAS to other configured peers.
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
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.
The output returns information such as the server URL, network interface, receive rate, transmit rate, and system messages.
The command has the following syntax:
- 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
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:
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:
- 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:
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:
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.
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:
The command has the following syntax:
- 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:
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:
- Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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
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.
The output of the above command is something similar to:
The command has the following syntax:
- 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:
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:
- Replace
myminiowith thealiasof the MinIO deployment that should run the job. - Replace
./replication.yamlwith 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:
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:
The mc cat command has the following syntax:
- 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:
You can specify multiple objects on the same or different MinIO deployment. For example:
For an object on a local filesystem, specify the full path to that object. For example:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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#ssformat. 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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the object on the S3-compatible host. - Replace
DURATIONwith the point-in-time in the past at which the command returns the object. For example, specify30dto return the version of the object 30 days prior to the current date.
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the object on the S3-compatible host. - Replace
VERSIONwith the specific version of the object to return.
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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
minioalias:
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:
-
Replace
ALIASwith the alias of a MinIO deployment configured for AD/LDAP integration. -
Replace
DNwith 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:
--all
mc-cmd
Optional
Added: mc
RELEASE.2024-07-31T15-58-33Z
List all access keys for all LDAP users.
--self
mc-cmd
Optional
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.
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.
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.
List a User’s Access Keys
The following command returns the AD/LDAP access keys for the user bobfisher on the minio deployment.
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.
List Access Keys for Authenticated User
The following command returns the AD/LDAP access keys for the currently authenticated user on the minio deployment.
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.
The command has the following syntax:
-
Replace
ALIASwith 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:
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
Changed: RELEASE.2022-12-24T15-21-38Z
mc ilm rule ls replaces mc ilm ls.
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:
The output of the command might resemble the following:
The mc ilm rule ls command has the following syntax:
- 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:
--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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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.
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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:
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
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:.
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.
The command has the following syntax:
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:
The command has the following syntax:
- 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.
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:
- Replace
primary/datawith theALIASand full bucket path for which to create the replication configuration. - Replace the
--remote-bucketvalue with the ARN of the remote target. Usemc replicate lsto 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
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.
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.
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.
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).
Syntax
The mc support profile command has the following syntax:
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:
cpucpuiomemblockmutextracethreadsgoroutines
If not specified, the command collects data for CPU, memory, block, mutex, threads, and goroutines.
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
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.
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
The command has the following syntax:
- 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:
The command has the following syntax:
- 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:
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:
- Replace
POLICYwith a supportedPOLICY. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith the destination bucket.
Remove Anonymous Policy for Bucket
Use mc anonymous set to clear the anonymous policy for a bucket:
- Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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
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.
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.
The command has the following syntax:
- 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:
- Replace
myminiowith thealiasof the MinIO deployment that should run the job.
The output of the above command is similar to the following:
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
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:
The mc cp command has the following syntax:
- 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:
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:
For copying an object from a local filesystem, specify the full path to that object. For example:
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:
For copying an object from a local filesystem, specify the full path to that object. For example:
--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
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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
Specify an existing data key on the external KMS. See the |
For example:
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-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:
You can specify the parameter multiple times to denote different object(s) to encrypt:
Specify the path to a prefix to apply encryption to all matching objects at that path:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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.
--legal-hold
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:
Bfor bytesKfor kilobytesMfor megabytesGfor gigabytesTfor terabytesKifor kibibytesMifor mibibytesGifor gibibytesTifor tebibytes
For example, to limit download rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesMfor megabytesGfor gigabytesTfor terabytesKifor kibibytesMifor mibibytesGifor gibibytesTifor tebibytes
For example, to limit upload rates to no more than 1 GiB/s, use the following:
If not specified, MinIO uses an unlimited upload rate.
--md5
mc-cmd
Optional
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:
GOVERNANCECOMPLIANCE
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#ssformat. 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:
- Replace
SRCALIASwith thealiasof a source S3-compatible host. - Replace
SRCPATHwith the path to the object on the S3-compatible host. - Replace
TGTALIASwith thealiasof a target S3-compatible host. - Replace
TGTPATHwith the path to the object on a target S3-compatible host. Omit the object name to use theSRCPATHobject name.
Recursively Copy Objects to S3
Use mc cp --recursive to recursively copy objects to an S3-compatible host:
- Replace
SRCALIASwith thealiasof a source S3-compatible host. - Replace
SRCPATHwith the path to the bucket or bucket prefix on the source S3-compatible host. - Replace
TGTALIASwith thealiasof a target S3-compatible host. - Replace
TGTPATHwith the path to the object on the target S3-compatible host.mc cpuses theSRCPATHobject 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.
- Replace
DURATIONwith the point-in-time in the past at which the command copies the object. For example, specify30dto copy the version of the object 30 days prior to the current date. - Replace
SRCALIASwith thealiasof a source S3-compatible host. - Replace
SRCPATHwith the path to the object on the source S3-compatible host. - Replace
TGTALIASwith thealiasof a target S3-compatible host. - Replace
TGTPATHwith the path to the object on the target S3-compatible host. Omit the object name to use theSRCPATHobject name.
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.
- Replace
VERSIONwith the version of the object to copy. - Replace
SRCALIASwith thealiasof a source S3-compatible host. - Replace
SRCPATHwith the path to the object on the source S3-compatible host. - Replace
TGTALIASwith thealiasof a target S3-compatible host. - Replace
TGTPATHwith the path to the object on the target S3-compatible host. Omit the object name to use theSRCPATHobject name.
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.
- Replace
CONTENT-TYPEwith the desired content type (also called a media type). - Replace
SRCALIASwith thealiasof a source S3-compatible host. - Replace
SRCPATHwith the path to the object on the source S3-compatible host. - Replace
TGTALIASwith thealiasof a target S3-compatible host. - Replace
TGTPATHwith the path to the object on the target S3-compatible host. Omit the object name to use theSRCPATHobject name.
The following example sets a content-type of application/json:
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
mykeyfrom theminiodeployment:
The command has the following syntax:
-
Replace
ALIASwith the alias of a MinIO deployment configured for AD/LDAP integration. -
Replace
KEYwith 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:
KEY
mc-cmd
Required
The configured access key to delete.
Example
Delete the access key mykey from the minio 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.
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.
The command has the following syntax:
-
Replace
ALIASwith 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:
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
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:
The command has the following syntax:
- 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:
--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:
- Replace
RULEwith the unique identifier of the lifecycle management rule. Usemc ilm rule lsto find the ID to use. - Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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
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.
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:.
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:
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:
- Amazon S3 Permissions
- Google Cloud Storage Access Control
- Authorizing access to data in Azure storage
Syntax
The following example updates the credentials for an existing remote tier called S3TIER on the myminio deployment.
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:
- 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
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
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
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.
- Replace
S3TIERwith the name for your Amazon Simple Storage Solution tier. - Replace
ACCESS_KEYwith the updated access key for your S3 storage. - Replace
SECRET_KEYwith 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.
- Replace
AZTIERwith the name for your Azure tier. - Replace
ACCOUNT-KEYwith 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.
- Replace
GCSTIERwith the name for your Google Cloud Storage tier. - Replace
/path/to/credentials.jsonwith 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
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.
The following command removes the replication rule with specified id from the mydata bucket on the myminio MinIO deployment:
The command has the following syntax:
- 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:
--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:
- Replace
IDwith the unique ID of the replication rule to remove. Usemc replicate lsto list all replication rules for the bucket. - Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith the path to the bucket or bucket prefix.
Remove All Replication Rules from a Bucket
Use mc replicate rm to list bucket replication rules:
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith 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.
Remove the Proxy URL Configured for a Deployment
The following command removes the URL configured as the proxy for the alias minio1.
Disable callhome Logs
The following command shows the URL configured as the proxy for the alias 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 show
mc-cmd
Display the current proxy URL configured for communicating with MinIO SUBNET.
mc support proxy remove
mc-cmd
Remove the proxy URL configured for communicating with MinIO SUBNET.
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:
The mc diff command has the following syntax:
- 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:
For an object from a local filesystem, specify the full path to that object. For example:
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:
For an object from a local filesystem, specify the full path to that object. For example:
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.
Behavior
Output Legend
mc diff uses the following legend when formatting the diff output:
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.
The command has the following syntax:
-
Replace
ALIASwith 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 ofPARAMETER="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:
server_addr
mc-cmd
Required
Specify the hostname for the Active Directory / LDAP server. For example:
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.
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
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.
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:
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:
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:
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:
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
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:
For SRV record names with beginning with _ldaps, specify ldaps. The constructed DNS SRV record name resembles the following:
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.
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:
The command has the following syntax:
- 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:
--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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit download rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesGfor gigabytesTfor terabytesKifor kibibytesGifor gibibytesTifor tebibytes
For example, to limit upload rates to no more than 1 GiB/s, use the following:
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:
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith the path to the bucket or bucket prefix.
Behavior
Removed and Re-added ARNs
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
Changed: RELEASE.2022-08-11T00-30-48Z
mc support top replaces the mc admin top command.
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
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:
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:
The output resembles the following:
The mc du command has the following syntax:
- 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:
You can specify multiple buckets and folders on the same or different MinIO deployment. For example:
For a folder on a local filesystem, specify the full path to that folder. For example:
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#ssformat. 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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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:
- Replace
DURATIONwith the desired point-in-time in the past. For example, specify30dto show the disk usage 30 days prior to the current date. - Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the bucket or folder on the S3-compatible host.
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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:
The command has the following syntax:
- 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:
Global Flags
This command supports any of the global flags.
Examples
Export Existing Replication Rules
Use mc replicate export to export bucket replication rules:
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith 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.
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:
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.
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.
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 |
|---|---|
The |
|
The |
|
The |
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:
The command has the following syntax:
- 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:
Global Flags
This command supports any of the global flags.
Examples
Import Existing Replication Rules
Use mc replicate import to import bucket replication rules:
- Replace
ALIASwith thealiasof the MinIO deployment. - Replace
PATHwith 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 |
|---|---|
The |
|
The |
|
The |
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:
The command has the following syntax:
- 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:
For objects on a filesystem, specify the full path to search. For example:
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
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
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
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
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
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to a bucket on the S3-compatible host. Omit the path to search from the root of the S3 host. - Replace
NAMEwith the object.
Find Objects with File Extension in Bucket
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to a bucket on the S3-compatible host. - Replace
EXTENSIONwith 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.
- Replace
FILEPATHwith the full file path to the directory to search. - Replace
EXTENSIONwith the file extension of the object. - Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to a bucket on the S3-compatible host.
To continuously watch the specified directory and copy new objects, include the --watch argument:
Find Objects with a Matching Tag
Note
Tag matching is only available for use on MinIO deployments.
- Replace
keywith the name of a tag key to match. - Replace
v*with the RE2 Regular Expression to evaluate against. - Replace
ALIASwith thealiasof the MinIO deployment. - Replace
BUCKETwith 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
Metadata matching is only available for use on MinIO deployments.
- Replace
content-type=text/csvwith the a key-value pair of the metadata field and value to match. - Replace
ALIASwith thealiasof the MinIO deployment. - Replace
BUCKETwith 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
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/.
The command has the following syntax:
- 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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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.
Retrieve an encrypted object from MinIO
The following command retrieves an encrypted file and places it at a local folder path.
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:
The command has the following syntax:
- 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:
You can specify multiple objects on the same or different MinIO deployments. For example:
For an object on a local filesystem, specify the full path to that object. For example:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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#ssformat. 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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith 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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the object on the S3-compatible host. - Replace
DURATIONwith the point-in-time in the past at which the command returns the object. For example, specify30dto return the version of the object 30 days prior to the current date.
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the object on the S3-compatible host. - Replace
VERSIONwith the version of the object. For example, specify30dto return the version of the object 30 days prior to the current date.
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
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
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 |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
|
The |
The |
|
The |
109 - mc idp ldap accesskey
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 |
|---|---|
The |
|
|
|
|
|
The |
|
The |
|
The |
|
The |
110 - mc idp ldap accesskey create-with-login
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.
The command has the following syntax:
-
Replace
URLwith 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:
--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.
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.
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.
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.
111 - mc idp ldap policy
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 |
|---|---|
The |
|
The |
|
The |
112 - mc idp openid
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
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.
The command has the following syntax:
- Replace
ALIASwith the alias of a MinIO deployment to configure for OpenID integration. - Replace
CFG_NAMEwith 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 ofPARAMETER="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.
The command has the following syntax:
- Replace
ALIASwith the alias of a MinIO deployment to configure for OpenID integration. - Replace
CFG_NAMEwith 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 ofPARAMETER="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.
The command has the following syntax:
- Replace
ALIASwith the alias of a MinIO deployment to configure for OpenID integration. - Replace
CFG_NAMEwith 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.
The command has the following syntax:
- Replace
ALIASwith 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.
The command has the following syntax:
- Replace
ALIASwith the alias of a MinIO deployment to configure for OpenID integration. - Replace
CFG_NAMEwith 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.
The command has the following syntax:
- Replace
ALIASwith the alias of a MinIO deployment to configure for OpenID integration. - Replace
CFG_NAMEwith 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.
The command has the following syntax:
- Replace
ALIASwith the alias of a MinIO deployment to configure for OpenID integration. - Replace
CFG_NAMEwith 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
- create tiers
- create tiering rules
- manage expiration rules for objects on a bucket
Subcommands
mc ilm includes the following subcommands:
Subcommand |
Description |
|---|---|
The |
|
The |
|
The |
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 |
|---|---|
The |
|
The |
|
The |
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 |
|---|---|
The |
|
The |
|
Use the |
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:
The output resembles the following:
STANDARDmarks objects stored on the MinIO deploymentWARMmarks objects stored on the remote tier with matching namevideos/indicates the prefix for the object
The command has the following syntax:
- 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:
For listing objects on a local filesystem, specify the full path to that object. For example:
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#ssformat. 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:
-
Replace
PATHwith the path to the bucket on the S3-compatible host.If specifying the path to the S3 root (
ALIASonly), include the--recursiveoption.
List Object Versions
Use mc ls --versions to list all versions of an object:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the bucket or object on the S3-compatible host.
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:
- Replace
ALIASwith thealiasof the S3-compatible host. - Replace
PATHwith the path to the bucket or object on the S3-compatible host. - Replace
DURATIONwith the point-in-time in the past at which the command returns the object. For example, specify30dto return the version of the object 30 days prior to the current date.
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.
The command has the following syntax:
- 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:
For creating a directory on a local filesystem, specify the full path to that directory. For example:
--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.
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:
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.
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
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
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.
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:
- 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:
ALIASis thealiasof a configured S3-compatible host, andPATHis the path to the bucket or object. If specifying a bucket,mc mirrorsynchronizes all objects in the bucket.
For files on a filesystem, specify the full filesystem path to the file or directory :
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:
ALIASis thealiasof a configured S3-compatible host, andPATHis the path to the bucket.
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
On site B, to mirror from B to A
--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
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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
Specify an existing data key on the external KMS. See the |
For example:
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-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:
You can specify the parameter multiple times to denote different object(s) to encrypt:
Specify the path to a prefix to apply encryption to all matching objects at that path:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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
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:
Bfor bytesKfor kilobytesMfor megabytesGfor gigabytesTfor terabytesKifor kibibytesMifor mibibytesGifor gibibytesTifor tebibytes
For example, to limit download rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesMfor megabytesGfor gigabytesTfor terabytesKifor kibibytesMifor mibibytesGifor gibibytesTifor tebibytes
For example, to limit upload rates to no more than 1 GiB/s, use the following:
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.
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
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.
--watchcontinuously synchronizes files from Source to Target until explicitly terminated- The Target may have files that do not exist on Source
--watchoverwrites objects on the Target if a match exists on Source, like the--overwriteflag
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:
- Replace
FILEPATHwith the full file path to the directory to mirror. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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:
- Replace
FILEPATHwith the full file path to the directory to mirror. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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.
- Replace
SRCALIASwithaliasof a configured S3-compatible host. - Replace
SRCPATHwith the bucket to mirror. - Replace
TGTALIASwith thealiasof a configured S3-compatible host. - Replace
TGTPATHwith 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.
- Replace
SRCALIASwith thealiasof a configured S3 host. - Replace
SRCPATHwith the bucket to mirror. - Replace
TGTALIASwith thealiasof a configured S3 host. - Replace
TGTPATHwith 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.jpgphotos/2021/february/myotherphoto.jpgphotos/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:
The command has the following syntax:
- 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:
For moving an object from a local filesystem, specify the full path to that object. For example:
Specify multiple
SOURCEpaths to move multiple objects to the specifiedTARGET.mc rmtreats the last specified alias or filesystem path as theTARGET. For example:If you specify a directory or bucket to
SOURCE, you must also specify--recursiveto recursively move the contents of that directory. If you omit the--recursiveargument,mvonly 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:
For moving an object from a local filesystem, specify the full path to that object. For example:
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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
Specify an existing data key on the external KMS. See the |
For example:
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-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:
You can specify the parameter multiple times to denote different object(s) to encrypt:
Specify the path to a prefix to apply encryption to all matching objects at that path:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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:
Bfor bytesKfor kilobytesMfor megabytesGfor gigabytesTfor terabytesKifor kibibytesMifor mibibytesGifor gibibytesTifor tebibytes
For example, to limit download rates to no more than 1 GiB/s, use the following:
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:
Bfor bytesKfor kilobytesMfor megabytesGfor gigabytesTfor terabytesKifor kibibytesMifor mibibytesGifor gibibytesTifor tebibytes
For example, to limit upload rates to no more than 1 GiB/s, use the following:
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
-
Replace
FILEPATHwith the full file path to the file to move.If specifying the path to a directory, include the
--recursiveflag.mc mvremoves the files from the source after successfully moving it to the destination. -
Replace
ALIASwith thealiasof a configured S3-compatible host. -
Replace
PATHwith 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).
- Replace
FILEPATHwith the full file path to the file to move.mc mvremoves the file from the source after successfully moving it to the destination. - Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith the destination bucket. - Replace
ATTRIBUTESwith one or more comma-separated key-value pairsKEY=VALUE. Each pair represents one attribute key and value.
Move Bucket Between S3-Compatible Services
- Replace
SRCALIASwith thealiasof a configured S3-compatible host. - Replace
SRCPATHwith the path to the bucket.mc mvremoves the bucket and its contents from the source after successfully moving it to the destination. - Replace
TGTALIASwith thealiasof a configured S3-compatible host. - Replace
TGTPATHwith 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.
-
Replace
CLASSwith the storage class to associate to the files. -
Replace
FILEPATHwith the full file path to the file to move.mc mvremoves the file from the source after successfully moving it to the destination. -
Replace
ALIASwith thealiasof a configured S3-compatible host. -
Replace
PATHwith the destination bucket. -
Replace
ATTRIBUTESwith one or more comma-separated key-value pairsKEY=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:
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.jpgphotos/2021/february/myotherphoto.jpgphotos/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.
If passing the --json global flag, the output of the command resembles the following:
The command has the following syntax:
- 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.
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.
- Replace
myminio/mybucket/file.zipwith the path of the object or file stream to upload. - Replace
sizewith 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.
- Replace
myminio/mybucket/file.zipwith the path of the object or file stream to upload. - Replace
sizewith the desired size of the object parts. - Replace
partswith 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.
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.
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.
The command pings the deployment at the alias play for five cycles. The output resembles the following:
The command has the following syntax:
- 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
--exit
mc-cmd
Optional
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
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.
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.
End Liveness Checks for Error Counts Greater Than 20
The following command sends continuous liveness checks until 20 errors have been encountered:
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.
The command has the following syntax:
- 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.
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
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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
Specify an existing data key on the external KMS. See the |
For example:
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-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:
You can specify the parameter multiple times to denote different object(s) to encrypt:
Specify the path to a prefix to apply encryption to all matching objects at that path:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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.
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.
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:
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.
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.
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.
123 - mc put
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.
The command has the following syntax:
- 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
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
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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
Specify an existing data key on the external KMS. See the |
For example:
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-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:
You can specify the parameter multiple times to denote different object(s) to encrypt:
Specify the path to a prefix to apply encryption to all matching objects at that path:
--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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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.
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.
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.
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:
The command has the following syntax:
- 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:
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:
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:
You can specify multiple ALIAS targets consisting of either MinIO or local filesystem directories. The command attempts to remove all specified targets. For example:
--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.
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
- Replace
ALIASwith thealiasof a configured S3-compatible host. - Replace
PATHwith 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.
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:
Once the request succeeds in connecting to the myminio deployment, the output resembles the following:
The command has the following syntax:
- 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.
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.
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
For multi-site replication, see mc admin replicate.
Subcommands
mc replicate includes the following subcommands:
Subcommand |
Description |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
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 |
|---|---|
The |
|
The |
|
The |
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.
The following command removes multiple objects from the mydata bucket on the myminio MinIO deployment:
The command has the following syntax:
- 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:
You can specify multiple objects on the same or different MinIO deployments. For example:
If specifying the path to a bucket or bucket prefix, you must also specify the --recursive and --force arguments. For example:
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:
--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.
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#ssformat. 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
- Replace
ALIASwith thealiasof a configured S3-compatible service. - Replace
PATHwith 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.
- Replace
ALIASwith thealiasof a configured S3-compatible service. - Replace
PATHwith 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.
- Replace
ALIASwith thealiasof a configured S3-compatible service. - Replace
PATHwith 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.
Important
Removing specific versions of an object is a destructive action. You cannot restore the deleted object versions.
- Replace
ALIASwith thealiasof a configured S3-compatible service. - Replace
PATHwith the path to the object. For example,/mybucket/myobject. - Replace
DURATIONwith 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.jpgphotos/2021/february/myotherphoto.jpgphotos/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.
- To remove a specific object version from a bucket, use
mc rm --version-id - To remove all versions of an object from a bucket, use
mc rm --versions - To remove all non-current versions of an object from a bucket, use
mc rm --non-current
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 |
|---|---|
The |
|
The |
|
The |
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:
The command has the following syntax:
- 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:
--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:
GZIPBZIP2NONE(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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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:
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith 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:
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith 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 |
|
Description |
|---|---|---|
|
The character that seperates each record (row) in the input Corresponds to |
|
|
The character that seperates each field in a record. Defaults to Corresponds to |
|
|
The character used for escaping when the Corresponds to |
|
|
The character used for escaping a quotation mark Corresponds to |
|
|
Yes |
The content of the first line in the Specify one of the following supported values:
For For Corresponds to |
|
Yes |
The character used to indicate a record should be ignored. The character must appear at the beginning of the record. Corresponds to |
|
Yes |
Specify Defaults to Corresponds to |
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:
The command has the following syntax:
- 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:
You can specify multiple objects on the same or different MinIO deployments:
If specifying the path to a bucket or bucket prefix, you must include the mc stat --recursive flag:
For retrieving information on a file from a local filesystem, specify the full path to that 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
|
The full path to the object as You can specify only the top-level path to use a single encryption key for all operations in that path. |
|
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 |
KEY- the full path to the object asalias/bucket/path/object.VALUE- the 32-byte RAW Base64-encoded data key to use for encrypting object(s).
For example:
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:
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#ssformat. 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:
The output resembles the following:
You can specify more than one object by adding multiple paths:
To display detail for all objects in a bucket, use --recursive. The following example displays details for all objects in bucket mybucket:
The output resembles the following:
Display Bucket Details
The following example displays information about the bucket mybucket on the myminio MinIO deployment:
The output resembles the following:
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:
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.
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 |
|---|---|
The |
|
The |
|
The |
|
Use the |
|
|
|
Use the |
|
The |
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 |
|---|---|
The |
|
The |
|
The |
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:
The command has the following syntax:
- 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:
You can specify multiple targets to the mc tree command. For example:
For retrieving the tree heirarchy of a local filesystem directory, specify the full path to that directory. For example:
--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#ssformat. 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
- Replace
ALIASwith the alias of the MinIO deployment. - Replace
PATHwith 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:
The command has the following syntax:
- 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:
This example reverts the most recent DELETE for the prefix archive, recursively restoring it and any child objects:
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:
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:
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:
The command has the following syntax:
- Brackets
[]indicate optional parameters. RELEASE-URLis 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:
Global Flags
--json
mc-cmd
Optional
Formats the disabled-update error as one JSON Lines object. This flag does not enable updating.
For example:
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 |
|---|---|
The |
|
The |
|
The |
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:
The command has the following syntax:
- 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:
--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:
Examples
Watch for Events in 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.
139 - mc idp ldap accesskey create
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
minioalias:
The command has the following syntax:
-
Replace
ALIASwith 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:
--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
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.
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.
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.
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.
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.