tencent cloud

Clearing Bucket
Last updated:2025-09-02 11:13:54
Clearing Bucket
Last updated: 2025-09-02 11:13:54

Overview

You can clear the specified bucket in the COS console. For more information on buckets, see Bucket Overview.
Note:
Clearing a bucket will delete all objects and incomplete multipart uploads in this bucket. The deleted data is unrecoverable and inaccessible. Proceed with caution.

Use Cases

Clearing a bucket through a lifecycle rule: This method is applicable to a bucket with more than 10,000 objects. A deletion job will be triggered when the trigger condition of a lifecycle rule is met. The job start and completion time are subject to the lifecycle rule configuration in the console.
Quickly clearing a bucket in the console: This method is applicable to a bucket with less than 10,000 objects. A bucket clearing job will take effect immediately upon completion.
Note:
If you have a large amount of data in your bucket, clearing the bucket using the console may be slow or even fail due to network reasons. In this case, we recommend you clear the bucket by setting lifecycle configuration.

Directions

Quickly clearing a bucket in the console

1. Log in to the COS console.
2. Click Bucket List on the left sidebar.
3. Find the target bucket and click More > Clear Data on the right.
4. In the pop-up window, enter the name of the bucket you want to clear and click Confirm.
5. In the pop-up window, click OK.

Clearing a bucket through a lifecycle rule

1. Log in to the COS console.
2. Click Bucket List on the left sidebar.
3. Locate the bucket for which you want to set the lifecycle feature. Click the bucket name to enter its details page.
4. Click Basic Configurations > Lifecycle and click Add a Rule.
5. In the Add Rule dialog box, set rules to delete all current version files and historical versions in the entire bucket. Configuration as follows:
Basic information:
Status: Enabled.
Rule name: Required. Enter your lifecycle rule name.
Policy type: Select "Last modification time". If you have enabled the allowlist feature for access tracking, this configuration item will be displayed. If this configuration item is not present, the default policy type is last modification time without requiring selection. For more information, see Setting lifecycle.
Application scope: Select entire bucket.
Exclusion range: Off.
Rule configuration:
Manage current version files: Set deletion 1 day after file modification time.
Manage files of noncurrent version: Set deletion 1 day after file modification time.
Delete fragments: Set deletion 1 day after fragment creation.
Note:
Since deleting bucket data is a high-risk operation, secondary confirmation is required. Click OK to proceed.
6. You can see that the deletion rule has been set successfully in the lifecycle rule list.
7. After the lifecycle rule is executed, you can see that both the number and volume of stored objects are zero on the bucket overview page, indicating that the bucket has been cleared. If you no longer use the bucket, you can delete it.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback