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.rst
2022-09-16 16:40:20 -04:00

4.3 KiB

mc version

minio

Table of Contents

mc version

Description

The mc version command enables, suspends, and retrieves the versioning <minio-bucket-versioning> configuration for a MinIO bucket.

EXAMPLE

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

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

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] version                    \
                 [enable | suspend | info]  \
                 ALIAS

Parameters

enable

Enables versioning on the MinIO bucket specified to ALIAS <mc version ALIAS>.

Mutually exclusive with ~mc version suspend and ~mc version info

suspend

Disables versioning on the MinIO bucket specified to ALIAS <mc version ALIAS>.

Mutually exclusive with ~mc version suspend and ~mc version info

info

Returns the versioning configuration for the MinIO bucket specified to ALIAS <mc version ALIAS>.

Mutually exclusive with ~mc version suspend and ~mc version info

ALIAS

Required The alias <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

Global Flags

Examples

Enable Bucket Versioning

Use mc version suspend to enable versioning on a bucket:

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

Disable Bucket Versioning

Use mc version suspend to suspend versioning on a bucket:

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

Get Bucket Versioning Status

Use mc version info to enable versioning on a bucket:

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

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 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 <mc rm --versions> to delete an object and all its versions.

S3 Compatibility