1
0
mirror of https://github.com/minio/docs.git synced 2025-09-17 18:22:26 +03:00
Files
docs/source/reference/minio-mc/mc-legalhold-set.rst
Andrea Longo 08eb7770dc Small docs fixes and cleanups (#1138)
Many small fixes:
- Clarify that `mc legalhold set --recursive` applies to current objects
only. Go back and do it again if you want it to apply to newly created
objects.
- Clean up inconsistent capitalization of "legal hold."
- Fix a bunch more `:required:` and `:optional:`
- Add a resync step to the restore site replication instructions

Staged:

http://192.241.195.202:9000/staging/small-clarifications/linux/index.html
2024-02-23 11:37:53 -07:00

4.2 KiB

mc legalhold set

minio

Table of Contents

mc legalhold set

Syntax

The mc legalhold set command enables legal hold <minio-object-locking-legalhold> Write-Once Read-Many (WORM) object locking on an object or objects.

mc legalhold requires that the specified bucket has object locking enabled <minio-object-locking>. 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 enables legalhold WORM locking on all existing objects in the mydata bucket on the myminio MinIO deployment:

mc legalhold set --recursive myminio/mydata

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] legalhold set  \
                 [--recursive]  \
                 [--rewind]     \
                 [--version-id] \
                 ALIAS

Parameters

ALIAS

The MinIO alias <alias> and path to the object or objects on which to enable the legal hold. For example:

mc legalhold set play/mybucket/myobjects/objects.txt

--recursive, r

Applies the legal hold to all existing objects in the ~mc legalhold set 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

--version-id, vid

Global Flags

Examples

Use mc legalhold set to enable legal hold on objects:

mc legalhold set [--recursive] ALIAS/PATH 
  • Replace ALIAS <mc legalhold set ALIAS> with the alias <alias> of the S3-compatible host.
  • Replace PATH <mc legalhold set ALIAS> with the path to the bucket or object on the S3-compatible host. If specifying the path to a bucket or bucket prefix, include the ~mc legalhold set --recursive option.

Behavior

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 are complementary to both minio-object-locking-governance and minio-object-locking-compliance 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