You can configure a lifecycle management rule for a bucket, and applicable objects in the bucket will be managed by the rule. You can transition the storage class of an object from Standard to Warm or Cold, or from Warm to Cold. However, an object in the Cold storage class cannot be transitioned to other storage classes by configuring the lifecycle rule.
- Log in to OBS Browser.
- Click the blank area in the row of the bucket for which you want to configure a lifecycle rule and choose More > Configure Lifecycle Rule.
- In the Configure Lifecycle Rule dialog box, click Create. Figure 1 displays the Create Lifecycle Rule dialog box.
Figure 1 Creating a lifecycle rule
- Select Enable and configure required parameters, and click Save.
- Object name prefix cannot start or end with a slash (/), have two consecutive slashes (/), or contain the following special characters: \:*?"<>|
- When Object name prefix is selected and the specified prefix and the prefix of an existing lifecycle rule overlap, OBS regards the two rules as one and disables your rule. For example, if a rule with prefix abc exists in the system, another rule whose prefix starts with abc cannot be configured.
- If a lifecycle rule whose Applies To is set to Object name prefix has been configured, you cannot configure a lifecycle rule whose Applies To is set to Bucket.
- If a lifecycle rule whose Applies To is set to Bucket has been configured, you cannot configure a lifecycle rule whose Applies To is set to Object name prefix.
Current Version or Historical Version:
- Transition to Warm: You can specify the number of days after which objects that have been last updated and meet specified conditions are automatically transitioned to Warm. This number must be at least 30.
- Transition to Cold: You can specify the number of days after which objects that have been last updated and meet specified conditions are automatically transitioned to Cold. If objects are configured to be transitioned to both Warm and Cold, the number of days for transition to Cold must be at least 30 days later than that for transition to Warm. If only transition to Cold is enabled and transition to Warm is disabled, there is no limit on the number of days for transition.
- Expiration Time: You can specify the number of days after which objects that have been last updated and meet specified conditions are automatically deleted. The expiration time must be greater than the two transition times.
- Current Version and Historical Version are two concepts for Versioning. If Versioning is enabled, uploading objects with the same name to the same path generates different versions. The object uploaded later is called Current Version, and the object uploaded earlier is called Historical Version.
- You can configure either, both, or neither of the versions.
For example, the following files are stored on OBS on January 7, 2015:
The following files are stored on OBS on January 10, 2015:
If objects prefixed with log is set to expire in 1 Day on January 10, 2015, OBS will delete objects log/test1.log, log/test2.log, log/clientlog.log, and log/serverlog.log on January 12, 2015.
On the day of operation, you can set the objects with the name prefix log to be transitioned to Warm 30 days later, transitioned to Cold 60 days later, and deleted 100 days later. Then OBS will transition log/clientlog.log, log/serverlog.log, log/test1.log, and log/test2.log to Warm on the 31st day, transition them to Cold the 61st day, and delete them on the 101st day, respectively.
The storage class transition and deletion of an object may be delayed after the time condition is met. Generally, the delay does not exceed 48 hours.
- In the Create Lifecycle Rule dialog box, click Save to save the lifecycle rule.
- In the dialog box that is displayed, click OK.