mc version enable
Syntax
The mc version enable command enables versioning on the specified bucket.
The following command enables versioning for the mybucket bucket on the myminio MinIO deployment:
The command has the following syntax:
- 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.
Parameters
ALIAS
mc-cmd
Required
The alias of a MinIO deployment and the full path to the bucket for which to enable versioning. For example:
--exclude-folders
mc-cmd
Optional
Disable versioning on all folders (objects whose name ends with /) in the specified bucket.
--excluded-prefixes
mc-cmd
Optional
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:
Global Flags
This command supports any of the global flags.
Example
Enable Bucket Versioning
Use mc version enable to enable versioning for a bucket:
- Replace
ALIASwith thealiasof a configured MinIO deployment. - Replace
PATHwith 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
SILO is the supported server for PGSTY mcli; compatibility with upstream MinIO and other S3 services is best effort.