Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-09-14 16:17:51
KS3 allows you to delete multiple objects at a time or change their storage classes at a specified point in time or after a specified period of time after the objects are last modified. You can implement this feature by create lifecycle rules for a bucket.
To create a lifecycle rule, perform the following steps:
After lifecycle rules are created, you can enable or disable them.
You can create a maximum of 1,000 rules for each bucket.
For objects that were uploaded before April 12, 2017, you cannot delete them or change the storage classes for them.
Console operations: Manage lifecycle
The status of a rule indicates whether the rule is enabled or disabled.
The policy of a rule specifies the objects that match the rule. KS3 supports the following rule matching methods:
Matching by prefix
pics/
and the other rule matches pics/program
for the same bucket, KS3 returns an error.Matching by tag
You can specify multiple tags for a rule. The rule matches objects with all the specified tags.
Matching by prefix and tag: A rule match objects with the specified prefix and one or more tags.
For example, a bucket contains the following objects:
pics/dog.gif
pics/cat.gif
pics/bird.gif
docs/readme.txt
If the prefix pics/
is specified for a rule, the rule applies to the first three objects whose names start with pics/
. If the prefix docs/readme.txt
is specified for a rule, the rule applies only to the object docs/readme.txt
.
You can specify an expiration period in days or an expiration date.
If you specify an expiration period, the matching objects are deleted or their storage classes are changed after the specified number of days after the objects are last modified.
For example, you can create a rule that applies to all objects to delete objects three days after they are last modified. If Object 1 is last modified at 2018-08-01 18:01:26, it is deleted three days later at 2018-08-05 00:00:00. If Object 2 is last modified at 2018-08-03 18:01:26, it is deleted three days later at 2018-08-07 00:00:00.
If you specify an expiration date, the objects whose last modification dates are before the specified date are deleted or their storage classes are changed.
For example, you can create a rule to change the storage classes of matching objects to IA and specify the expiration date 2018-01-01T00:00:00.000Z for the rule. If Object 1 is last modified at 2017-08-01 18:01:26, its storage class is changed to IA. If Object 2 is last modified at 2018-08-02 18:01:26, its storage class is not changed.
You can specify an expiration period or an expiration date for a rule or disable the rule. If you enable a rule, it takes effect within one day. For example, if you enable a rule at 03:00 pm, the rule takes effect at 00:00 the next day. After the conditions are met and the action is triggered, it takes a period of time for KS3 to change the storage class. This period of time is related to the number of objects.
You can specify an expiration period or an expiration date for a rule or disable the rule. If you enable a rule, it takes effect within one day. For example, if you enable a rule at 03:00 pm, the rule takes effect at 00:00 the next day. After the conditions are met and the action is triggered, it takes a period of time for KS3 to change the storage class. This period of time is related to the number of objects.
If you enable a rule, it takes effect within one day. For example, if you enable a rule at 03:00 pm, the rule takes effect at 00:00 the next day. After the conditions are met and the action is triggered, it takes a period of time for KS3 to delete the objects. This period of time is related to the number of objects.
Effect of prefix-based rules A prefix-based rule applies to an object as long as the name of the object matches the specified prefix. For example, a bucket contains the following objects:
logs/program.log.1
logs/program.log.2
logs/program.log.3
doc/readme.txt
If the prefix logs/
is specified for a rule, the rule applies to the first three objects whose names start with logs/
. If the prefix docs/readme.txt
is specified for a rule, the rule applies only to the object docs/readme.txt
.
Conflicting rules If an object matches multiple rules with different actions at the same time, KS3 executes the actions in the following order: Delete the object > Change the storage class to Archive > Change the storage class to IA. Example Assume that you have configured the following rules.
Rule No. | Prefix | Tag | Action |
---|---|---|---|
Rule 1 | 123 | a=1 | Delete a matching object 20 days after the object is last modified. |
Rule 2 | 12345 | a=1 | Change the storage class of a matching object to Archive 20 days after the object is last modified. |
Rule 3 | 1233456 | a=1 | Change the storage class of a matching object to IA 20 days after the object is last modified. |
Objects that match the prefix 123
and has the tag a=1
are deleted 20 days after they are last modified based on Rule 1. After the objects are deleted, no objects match Rule 2 or Rule 3, which are therefore meaningless.
Pure Mode