1
0
mirror of https://github.com/minio/docs.git synced 2025-04-25 17:22:39 +03:00
docs/source/reference/minio-mc/mc-version-enable.rst
Andrea Longo 00f1c7f6c4
Clarify several small items in the mc reference (#1103)
A few opportunistic text updates:

- `mc mirror` recommends `mc replicate` and `mc admin replicate` for
other use cases. Mention what they are for.
- Clarify that `mc version` creates a null version id for existing
unversioned objects when bucket versioning is enabled.


http://192.241.195.202:9000/staging/mc-mirror-clarification/linux/reference/minio-mc/mc-mirror.html

http://192.241.195.202:9000/staging/mc-mirror-clarification/linux/reference/minio-mc/mc-version.html#bucket-versioning-with-existing-data

---------

Co-authored-by: Ravind Kumar <ravind@min.io>
2024-01-05 09:38:16 -07:00

2.9 KiB

mc version enable

minio

Table of Contents

mc version enable

Syntax

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

EXAMPLE

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

mc version enable myminio/mybucket

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] version enable ALIAS                \
                            --exclude-folders    \
            --excluded-prefixes

Parameters

ALIAS

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

mc version enable myminio/mybucket

--exclude-folders

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

--excluded-prefixes

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

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

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

Global Flags

Example

Enable Bucket Versioning

Use mc version enable to enable versioning for a bucket:

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

Behavior

Bucket Versioning with Existing Data

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

S3 Compatibility