1
0
mirror of https://github.com/minio/docs.git synced 2025-07-30 07:03:26 +03:00
Files
docs/source/reference/minio-mc/mc-retention-info.rst
Andrea Longo 1f8ce6dec2 Add reference page for mc du (#783)
Create a new reference page for `mc du` and link it in the list of `mc`
commands.

Staged:

http://192.241.195.202:9000/staging/DOCS-764/linux/html/reference/minio-mc/mc-du.html

Includes drive-by fixes to make the _Optional_ notations appear in a
more consistent manner. (Including several otherwise unrelated pages.)
There's more opportunistic fixes here than I might normally do in the
same PR, but seemed better to get it over with.

Fixes https://github.com/minio/docs/issues/764

---------

Co-authored-by: Ravind Kumar <ravind@min.io>
2023-03-30 13:36:41 -06:00

6.6 KiB

mc retention info

minio

Table of Contents

mc retention info

Syntax

The mc retention info command configures the Write-Once Read-Many (WORM) locking <minio-object-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 <minio-object-locking-legalhold>, 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.

EXAMPLE

The following command returns the default object lock configuration for the mydata bucket on the myminio MinIO deployment:

mc retention info --default myminio/mydata

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] retention info            \
                 [--default]               \
                 [--recursive]             \
                 [--rewind "string"]       \
                 [--version-id "string"]*  \
                 [--versions]              \
                 ALIAS

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

Parameters

ALIAS

Required

The full path to the object for which to retrieve the object lock configuration. Specify the alias <alias> of a configured S3-compatible service as the prefix to the ALIAS bucket path. For example:

mc retention info play/mybucket/object.txt
  • If the ALIAS specifies a bucket or bucket prefix, include

    ~mc retention info --recursive to return the object lock settings for all objects in the bucket or bucket prefix.

  • If the ALIAS bucket has versioning enabled,

    mc retention info by default applies to only the latest object version. Use ~mc retention info --version-id or ~mc retention info --versions to return the object lock settings for a specific version or for all versions of the object.

--default

Optional Returns the default object lock settings for the bucket specified to ~mc retention info ALIAS.

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

--recursive, r

Optional Recursively returns the object lock settings for all objects in the specified ~mc retention info ALIAS path.

Mutually exclusive with ~mc retention info --version-id.

--rewind

--version-id, vid

Mutually exclusive with any of the following flags:

  • ~mc retention info --versions
  • ~mc retention info --rewind
  • ~mc retention info --recursive
--versions

Use ~mc retention info --versions and ~mc retention info --rewind together to retrieve the retention settings for all object versions that existed at a specific point-in-time.

Global Flags

Examples

Retrieve Object Lock Settings for an Object or Object(s)

Specific Object

mc retention info ALIAS/PATH
  • Replace ALIAS <mc retention info ALIAS> with the alias <mc alias> of a configured S3-compatible host.
  • Replace PATH <mc retention info ALIAS> with the path to the object.

Multiple Objects

Use mc retention info with ~mc retention info --recursive to retrieve the retention settings for all objects in a bucket:

mc retention info --recursive ALIAS/PATH
  • Replace ALIAS <mc retention info ALIAS> with the alias <mc alias> of a configured S3-compatible host.
  • Replace PATH <mc retention info ALIAS> with the path to the bucket.

Retrieve Default Object Lock Settings for a Bucket

Use mc retention info with ~mc retention info --default to retrieve the default object lock settings for a bucket:

mc retention info --default ALIAS/PATH
  • Replace ALIAS <mc retention info ALIAS> with the

    alias <mc alias> of a configured S3-compatible host.

  • Replace PATH <mc retention info ALIAS> with the path to the bucket.

S3 Compatibility