mc ilm edit

Syntax

The mc ilm edit command modifies an existing object lifecycle management rule on a MinIO bucket.

The following command modifies existing lifecycle management rules for the mydata bucket on the myminio deployment:

mc ilm edit --id "c79ntj94b0t6rukh6lr0" --expiry-days 90  mydata/myminio

mc ilm edit --id "c79nu2p4b0t6qko19rgg" --expired-object-delete-marker mydata/myminio

mc ilm edit --id "c79n19dn10dnab109fg1" --transition-days 30 --storage-class "COLDTIER"

The command modifies the specified rules as follows:

  • Delete objects more than 90 days old.

  • Delete DeleteMarker tombstones if that object has no other versions remaining.

  • Transition objects more than 30 days old to the COLDTIER remote tier.

The command has the following syntax:

mc [GLOBALFLAGS] ilm edit \
                 --id "string"                                                                                        \
                 [--expiry-days "string" | --expired-object-delete-marker]                                            \
                 [--transition-days "string"] --storage-class "string"                                                \
                 [--noncurrentversion-expiration-days "string"]                                                       \
                 [--noncurrentversion-transition-days "string" --noncurrentversion-transition-storage-class "string"] \
                 [--tags]                                                                                             \
                 ALIAS
  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters seperated 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

Required The alias and full path to the bucket on the MinIO deployment to which to modify the object lifecycle management rule. For example:

mc ilm edit myminio/mydata
--id

Required The unique ID of the rule. Use mc ilm ls to list bucket rules and retrieve the id for the rule you want to modify.

--expiry-days

Optional The number of days to retain an object after being created. MinIO marks the object for deletion after the specified number of days pass.

Exercise caution when using this option, as its behavior can result in immediate expiration of uploaded objects. Any objects created after the specified expiration date are automatically eligible for expiration. Similarly, specifying a calendar date that is prior to the current system host datetime marks all objects covered by the rule for deletion. Consider immediately removing any ILM rule using this option once the specified calendar date has passed.

For versioned buckets, the expiry rule applies only to the current object version. Use the --noncurrentversion-expiration-days option to apply expiration behavior to noncurrent object versions.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

Mutually exclusive with the following options:

--expired-object-delete-marker

Optional Specify this option to direct MinIO to remove delete markers for objects with no remaining object versions. Specifically, the delete marker is the only remaining “version” of the given object.

This option is mutually exclusive with the following option:

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrentversion-expiration-days

Optional The number of days to retain an object version after becoming non-current (i.e. a different version of that object is now the HEAD). MinIO marks noncurrent object versions for deletion after the specified number of days pass.

This option has the same behavior as the S3 NoncurrentVersionExpiration action.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrentversion-transition-days

Optional The number of days an object has been non-current (i.e. replaced by a newer version of that same object) after which MinIO marks the object version as eligible for transition. MinIO transitions the object to the configured remote storage tier specified to the --storage-class once the system host datetime passes that calendar date.

This option has no effect on non-versioned buckets. Requires specifying --noncurrentversion-transition-storage-class.

This option has the same behavior as the S3 NoncurrentVersionTransition action.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--noncurrentversion-transition-storage-class

Optional The remote storage tier to which MinIO transitions noncurrent objects versions. Specify a remote storage tier created by mc admin tier.

MinIO does not automatically migrate objects from the previously specified remote tier to the new remote tier. MinIO continues to route requests for objects stored on the old remote tier.

--tags

Optional One or more ampersand &-delimited key-value pairs describing the object tags to which to apply the lifecycle configuration rule.

This option is mutually exclusive with the following option:

--transition-days

Optional The number of calendar days from object creation after which MinIO marks an object as eligible for transition. MinIO transitions the object to the configured remote storage tier specified to the --storage-class.

For versioned buckets, the transition rule applies only to the current object version. Use the --noncurrentversion-transition-days option to apply transition behavior to noncurrent object versions.

Requires specifying --storage-class.

MinIO uses a scanner process to check objects against all configured lifecycle management rules. Slow scanning due to high IO workloads or limited system resources may delay application of lifecycle management rules. See Lifecycle Management Object Scanner for more information.

--storage-class

Optional The remote storage tier to which MinIO transition objects. Specify a remote storage tier created by mc admin tier.

Required if specifying --transition-days.

MinIO does not automatically migrate objects from the previously specified remote tier to the new remote tier. MinIO continues to route requests for objects stored on the old remote tier.

Global Flags

--debug
Optional

Enables verbose output to the console.

For example:

mc --debug COMMAND
--config-dir
Optional

The path to a JSON formatted configuration file that mc uses for storing data. See Configuration File for more information on how mc uses the configuration file.

--JSON
Optional

Enables JSON lines formatted output to the console.

For example:

mc --JSON COMMAND
--no-color
Optional

Disables the built-in color theme for console output. Useful for dumb terminals.

--quiet
Optional

Suppresses console output.

--insecure
Optional

Disables TLS/SSL certificate verification. Allows TLS connectivity to servers with invalid certificates. Exercise caution when using this option against untrusted S3 hosts.

--version
Optional

Displays the current version of mc.

--help
Optional

Displays a summary of command usage on the terminal.

Examples

Modify an Existing Lifecycle Management Rule

Use mc ilm edit with --id to modify an existing object expiration rule:

mc ilm edit ALIAS/PATH --id "RULEID" [FLAGS]
  • Replace ALIAS with the alias of the S3-compatible host.

  • Replace PATH with the path to the bucket on the S3-compatible host.

  • Replace RULEID with the unique ID of the object lifecycle management rule.

  • Specify any additional flags to add or modify the lifecycle management rule. For example, specify --transition-days to override the existing transition days value for the rule.

Behavior

S3 Compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested MinIO and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.