Documentation

mc version

The mc version command enables, suspends, and retrieves the versioning status for a MinIO bucket.

The following command enables, suspends, and retrieves versioning status for the mydata bucket on the myminio MinIO deployment:

mc version enable myminio/mydata
mc version suspend myminio/mydata
mc version info myminio/mydata

The command has the following syntax:

mc [GLOBALFLAGS] version                    \
                 [enable | suspend | info]  \
                 ALIAS
  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

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

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

Required

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

mc version enable myminio/mybucket
Optional

Enables versioning on the MinIO bucket specified to ALIAS.

Mutually exclusive with suspend and info

Optional

Use with mc version enable to disable versioning on all folders (objects whose name ends with /) in the specified bucket.

Optional

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

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

mc version enable --excluded-prefixes "_test, _temp" local/my-bucket
Optional

Returns the versioning status for the MinIO bucket specified to ALIAS.

Mutually exclusive with suspend and enable

Optional

Disables versioning on the MinIO bucket specified to ALIAS.

Mutually exclusive with enable and info

Optional

Enables JSON lines formatted output to the console.

For example:

mc --JSON COMMAND

Use mc version enable to enable versioning on a bucket:

mc version enable ALIAS/PATH
  • Replace ALIAS with the alias of a configured MinIO deployment.

  • Replace PATH with the bucket on which to enable versioning.

Use mc version suspend to suspend versioning on a bucket:

mc version suspend ALIAS/PATH
  • Replace ALIAS with the alias of a configured MinIO deployment.

  • Replace PATH with the bucket on which to suspend versioning.

Use mc version info to retrieve the versioning status for a bucket:

mc version info ALIAS/PATH
  • Replace ALIAS with the alias of a configured MinIO deployment.

  • Replace PATH with the bucket on which to retrieve the versioning status.

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.

Enabling bucket versioning on a bucket with existing data immediately applies a versioning ID to any 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.

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.