OBS charging is based on consumed storage capacity and service time. For example, a company has a large number of video or audio data to be backed up or archived in OBS. In the initial period of time, these files may be frequently accessed. However, these files may not be accessed any more, after a certain period of time. Therefore, the company can delete the files that are not to be accessed any more, to reduce cost and use OBS more efficiently.
You can use OBS Console and OBS Browser to store data. When using OBS for data backup or archive, you may need to store a large amount of data. In such cases, you can use OBS Browser to upload the data in batches. The batch upload function of OBS Browser greatly shortens the time for data upload.
- Log in to OBS Console.
- Create the AK and SK that will be used to access OBS Browser.
- In the upper right corner of the OBS Console page, click the username and choose My Credential, as shown in Figure 1.
Figure 1 Choosing My Credential
- My Credential page is displayed. Choose Access Keys > Add Access Key, as shown in Figure 2.
Each user can create a maximum of two valid access keys.
Figure 2 Adding access key
- In the Add Access Key dialog box that is displayed, enter the password and its verification code.
- If you have not bound an email address or mobile number, enter only the password.
- If you have bound an email address and a mobile number, you can select the verification from either of these options.
- Click OK.
- Save the key as prompted. The key is directly saved to the default download folder of the browser.
To prevent the access keys from being leaked, keep it secure. If you click Cancel in the dialog box, the access keys will not be downloaded, and you cannot download them later. You can re-create an access key if you need to use it.
- Open the downloaded credentials.csv file to obtain the access keys (AK and SK).
- Use the access key created in 2 to log in to OBS Browser, as shown in Figure 3.
Figure 3 OBS Browser account - OBS
- Create different storage types of buckets based on different application scenarios.
- Backup scenario: Click Add Bucket. On the displayed dialog box, select Warm for Storage Class. Enter the bucket name and the selected region and click OK to create a bucket of the Warm storage class to store the backup data.
- Archive scenario: Click Add Bucket. On the displayed dialog box, select Cold for Storage Class. Enter the bucket name and the selected region and click OK to create a bucket of the Cold storage class to store the archive data.
- Upload the data to be backed up or archived to the newly created bucket.
- Click the icon at the upper left corner of the displayed page to return to the bucket list.
- Right-click the bucket where the backup or archive data is stored, and select Configure Lifecycle Rule to go to the life cycle configuration page.
- In the Configure Lifecycle Rule dialog box, click Create. Figure 4 displays the Create Lifecycle Rule dialog box.
Figure 4 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.
- Click Save to save the lifecycle rule.