mc ilm edit

Syntax

Run mc ilm edit to list all object lifecycle rules.

 mc ilm edit [COMMAND FLAGS] TARGET
 
 FLAGS:           
   --id value                                      id of the rule to be modified
   --prefix value                                  object prefix
   --tags value                                    format '<key1>=<value1>&<key2>=<value2>&<key3>=<value3>', multiple values allowed for multiple key/value pairs
   --size-lt value                                 objects with size less than this value (in bytes) will be selected for the lifecycle action
   --size-gt value                                 objects with size greater than this value (in bytes) will be selected for the lifecycle action
   --expire-date value                             format 'YYYY-MM-DD' the date of expiration
   --expire-days value                             the number of days to expiration
   --noncurrent-expire-days value                  the number of days to remove noncurrent versions (default: 0)
   --noncurrent-expire-newer value                 number of newer non-current object versions to retain (default: 0)
   --expire-delete-marker                          remove delete markers with no parallel versions
   --abort-incomplete-multipart-upload-days value  abort any incomplete multipart uploads that have not aborted in number of days (default: 0)
   --disable                                       disable the rule
   --enable                                        enable the rule
   --json                                          enable JSON lines formatted output
   --debug                                         enable debug output
   --insecure                                      disable SSL certificate verification
   --help, -h                                      show help

Parameters

Parameter Description
--id the rule ID of the object lifecycle rule to modify.
--prefix The object prefix. This is an optional parameter.
--tags One or more ampersand(&) delimited key-value pairs describing the object tags to use for filtering objects to which the lifecycle configuration rule applies. This is an optional parameter.
NOTE
Tags are not populated for delete markers and incomplete multi-part objects that still in progress. The --tags option is mutually exclusive with --expire-delete-marker and abort-incomplete-multipart-upload-days.
--size-lt Select fully uploaded objects smaller than the specified value. Enter the value as a number and a unit, such as 1m for 1 MB. This option is mutually exclusive option with --expire-delete-marker and abort-incomplete-multipart-upload-days. This is an optional parameter. Unit is added as a suffix to the number and indicated as follows: k for KB, m for MB, g for GB, t for TB, ki for kiB, mi for MiB, gi for GiB, ti for TiB.
--size-gt Select fully uploaded objects larger than the specified value qualify for the expiration rule. Enter the value as a number and a unit, such as 5GiB for 5 gibibytes. This option is mutually exclusive option with --expire-delete-marker and abort-incomplete-multipart-upload-days.
--expire-date Deletes all objects that are eligible for deletion on or before the specified date. This is an optional parameter.
--expire-days The number of days after which the object expires.
--noncurrent-expire-days The number of days to retain a non-current or older object version. The option marks the older object version for deletion after the specified number of days elapse. This is an optional parameter. The default value is 0.
--noncurrent-expire-newer The maximum number of non-current object versions to retain, when ordered from newest to oldest. Retains the newest of the number of past versions of a file. After retaining the maximum number of non-current versions, any remaining older or non-current object versions are marked for expiration. Updating the number for this flag only impacts the unmarked versions of objects. Any versions already marked for expiration do not change if you increase the number to retain. For example, if the value for this parameter is 3, the last 3 versions of the object would be retained and the object versions that are older than the last 3 would be marked for deletion/expiry. This is an optional parameter. The default value is 0.
--expire-delete-marker This option is used to remove the delete marker.
--abort-incomplete-multipart-upload-days The number of days after which an incomplete multi-part object upload must be aborted.
--disable Use this option to disable the object lifecycle rule.
--enable Use this option to enable the object lifecycle rule.
--help Use this option to display the command help.

Example

Modify the expiration date for an existing rule with id "meetingnotes"

CLI
$ mc ilm edit --id "meetingnotes" --expire-date "2020-09-17" s3/mybucket

Modify the expiration days for an existing rule with id "meetingnotes"

CLI
$ mc ilm edit --id "meetingnotes" --expire-days "300" s3/mybucket

Disable an existing rule with id "meetingnotes"

CLI
$ mc ilm edit --id "meetingnotes" --disable s3/mybucket