This command creates an S3 lifecycle rule.
Usage
lifecyclerule create --name NAME
--view-id ID
--enable|--disable
[--prefix PREFIX]
[--min-size SIZE]
[--max-size SIZE]
[--expiration-days DAYS]
[--enable-expired-obj-delete-marker|--disable-expired-obj-delete-marker]
[--noncurrent-days DAYS]
[--newer-noncurrent-versions VERSIONS]
[--abort-mpu-days-after-initiation DAYS]
[--object-age-attr MODIFICATION_TIME|ACCESS_TIME|CREATION_TIME]Required Parameters
| Specifies a name for the rule. |
| Specifies the ID of the view to which the rule applies. |
Options
| Enables the rule immediately upon its creation. |
| Specify this option to create a rule without enabling it immediately |
| Defines a prefix to limit the object scope by object prefix. In S3 terms, this is a prefix that may be common to multiple object keys (names). Specifying a prefix defines a scope of objects to which the rule applies. For example, if you specify
|
| Specifies a minimum object size to limit the scope by size. Specify SIZE as an integer followed by MB, GB, TB, etc. For example: |
| Specifies a maximum object size to limit the scope by size. Specify SIZE as an integer followed by MB, GB, TB, etc. For example: |
| Specifies a number of days after objects are created that they expire. In a non versioned bucket view, expiration means that the object is permanently removed. In a versioned bucket view, where the objects are versioned:
|
| Relevant only for versioned buckets. Enables deletion of expired object delete markers when they become expired object delete markers. An expired object delete marker is an object version that is the only version of an object and is also a delete marker. This parameter is mutually exclusive with |
| Relevant only for versioned buckets. Disables deletion of expired object delete markers when they become expired object delete markers. |
| Relevant only for versioned buckets. If provided, noncurrent versions of objects are deleted after the specified number of days, provided they are not the newest noncurrent versions up to the number set to be retained, if that number is provided with |
| Relevant only for versioned buckets. Use this parameter to specify a number of noncurrent versions of objects to retain. The newest non current versions up to this number will not expire even if they exceed |
| Specifies to remove incomplete multipart uploads, which are not removed through |
| Determines which timestamp to use as the time from which to count expiration days, if Possible values:
|
Example
vcli: admin> lifecyclerule create --name expirelogsrule --view-id 11 --enable --prefix /logs --expiration-days 60