• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide
  4. OBS Browser Operation Guide
  5. Lifecycle Management
  6. Configuring a Lifecycle Rule

Configuring a Lifecycle Rule

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.

Procedure

  1. Log in to OBS Browser.
  2. 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.
  3. In the Configure Lifecycle Rule dialog box, click Create. Figure 1 displays the Create Lifecycle Rule dialog box.

    Figure 1 Creating a lifecycle rule

  4. Select Enable and configure required parameters, and click Save.

    • Status

      Select Enable to enable the lifecycle rule.

    • Rule Name

      Identify lifecycle rules. The Rule Name contains a maximum of 255 characters.

    • Applies To: Can be set to Object name prefix or Bucket.
      • Object name prefix: Objects that have the specified prefix will be managed by the lifecycle rule.
      • Bucket: All objects in the bucket will be managed by the lifecycle rule.
    NOTE:
    • 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.
      NOTE:
      • 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:
    • log/test1.log
    • log/test2.log
    • doc/example.doc
    • doc/good.txt
    The following files are stored on OBS on January 10, 2015:
    • log/clientlog.log
    • log/serverlog.log
    • doc/work.doc
    • doc/travel.txt

      If objects prefixed with log is set to expire in 1 Day on January 10, 2015, OBS will delete objects log/test1.loglog/test2.loglog/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.loglog/serverlog.loglog/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.

    NOTE:

    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.

  5. In the Create Lifecycle Rule dialog box, click Save to save the lifecycle rule.
  6. In the dialog box that is displayed, click OK.