Warning
This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.
7.7 Setting up archives through lifecycle
As one of the use cases of Object Storage, it is widely used for disk image backup and file backup. You are more likely to use a recent backup, but you are less likely to use a backup otherwise, but you often need to keep it for a long period of time, for example. You have a requirement that you want to reduce your Storage costs even a little bit during the retention period.
Bucket of Object Storage has a function to manage the life cycle of stored objects. Provides a function to delete objects after a certain period of time has elapsed or move them to cheaper archive storage.
Setting up archives through lifecycle
Step 1. Grant Object Archive permission
-
Log in to the OCI console as an OCI full administrator.
-
Add object related policy permission to target group (SandboxGroup)
Additional privileges are required to do Object Archive. Adds the Manage Object Family permission.
allow service objectstorage-<region_name> to manage object-family in compartment <compartment_name>
-
Example: Name, ObjectStorageLifecyclePolicy
allow service objectstorage-ap-seoul-1 to manage object-family in compartment Sandbox
-
Step 2. Set the life cycle
-
Log in to the OCI console as a sandbox group user.
-
Go to the detail page of the Bucket (eg ExampleBucket) for which you want to set a lifecycle.
-
Click Resources > Lifecycle Policy Rules in the lower left corner.
-
Click Create Rule to create a new rule.
-
Create lifecycle rules
-
Name: Enter the name of the rule to be created.
-
Lifecycle Action:
- Select one of Move to Archive, Move to Infrequent Access, or Delete
-
Number of Days: Set the period of time to apply to objects older than a few days after creation
-
Object Name Filters: This is the area to specify the conditions for the target object in the Bucket. Currently, nothing is set.
- Like images/oracle.png, the prefix ‘images/’ based on the slash in the object name. Prefixes allow you to specify conditions for the target object.
-
-
After setting, click Create.
-
Lifecycle rules are set.
Step 3. Check the archived result
-
You can see that the set rule has been applied and has become Archived as shown in the figure.
-
In the archived state, download is not possible, so even if you access the object from the public bucket by URL, the following error occurs.
Step 4. Restoring
-
In order to download again in the archived state, restore the target object.
-
The downloadable time is 24 hours by default if no input is made. If you want to change it, you can designate it within the range of 1 hour to 240 hours. After recovery, it can be downloaded only for a specified period of time (default 24 hours), and after that, it becomes Archived again.
-
If you restore the status as shown below, it will take some time to complete. I’ve only tested it once, but here’s how long it took:
-
Request time: Jan 14, 2022 12:48:19 AM, GMT
-
Completion time: 05 08, 2019 11:20, GMT (estimated)
-
Time taken: about 3 hours
-
-
When the recovery is complete, you can download it now, and in the case of a public bucket, you can access the object by URL.
-
If you look at the detailed information of the object, the remaining downloadable time based on the set time is displayed as shown in the figure.
As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.