Lifecycle Rule

If you want to remove an object or set of objects from the bucket after a certain number of days. Applying the lifecycle rule can do this automatically. This will help you to reduce the size of your bucket. Lifecycle rules work on both versioning enabled and disabled buckets. It will provide you different ways to remove an object or set of objects on the basis of certain rules.

Setting Lifecycle Rule

../../_images/eos71.png
  1. Go to Storage -> Object-Storage option in the sidebar menu.

  2. Choose any bucket or create a new one.

  3. To create lifecycle rules click on “Action” in front of your bucket then select Lifecycle Rule or click on “Configure Lifecycle Rule” in the “Bucket Lifecycle” tab.

  4. Fill the form to set lifecycle rule
    • In the “Selected Bucket” option your bucket name will be displayed by default.
    • In the “Apply To” section just select either “Whole Bucket”(selected by default), to apply the rule for the whole bucket or “On Prefix”, to apply the rule on a specific prefix(prefix is the folder inside the bucket).
    • In the “Prefix” section write the prefix/folder name(please do not fill the name starting with “/”).
    • In Lifecycle Mode, Validity Period(Days) will be selected by default.
    • In the “Latest Object Versions Validity (days)” field, write the number of days after which you want to delete your latest (last updated) version of the objects(files).
    • In the “Previous Object Versions Validity (days)” field write the number of days after which you want to delete previous versions of the objects. You will be able to configure this rule only if the object versioning is enabled.
  5. If Object versioning is disabled and then you can only add a new lifecycle rule with the “Latest Object Versions Validity (days)” field.
    • The rule is applied from the date of upload of the object and delete after ‘n’ number of days. Here n is the number of days that you have filled in the Latest Object Versions Validity (days) field.

    Note

    Objects are permanently deleted, these objects can’t be recovered using minio client CLI.

  6. If Object versioning is enabled and you apply the lifecycle rule, the Latest Object Versions will be deleted after ‘n’ days and Previous Object Versions Validity will be deleted after ‘m’ days after it is last modified. Here ‘n’ and ‘m’ are the days that you will fill in the “Latest Object Versions Validity (days)” field and Previous Object Versions Validity (days) field respectively.

    Note

    • If the lifecycle rule is applied on only current versions of the objects, objects will not be permanently deleted, these objects can be recovered using minio client CLI.
    • If the lifecycle rule is applied on only previous versions of the object, all the non-current versions of the objects get permanently deleted(except the last updated one), these objects can’t be recovered using minio client CLI.
    • If the lifecycle rule is applied in both the current version and non-current versions of the objects. All the non-current versions get permanently deleted after ‘m’ days and the latest version of the object will get soft-deleted after ‘n’ no of days.
    • SOFT-DELETE -> This means this is not an actual delete. But a delete-marker is added on top of the latest object version. Which mocks to represent that the object is deleted. In case you want to un-delete and bring back the latest version of the objects. You can do it with the minio client CLI.

    Hint

    current version of the object is the last modified version of the object(file) and rest of the objects(files) are non-current versions.