Deleting an Object or Folder
Scenarios
On OBS Console, you can manually delete unneeded files or folders to release space and reduce costs.
Alternatively, you can configure lifecycle rules to periodically, automatically delete some or all of the files and folders from a bucket. For details, see Configuring a Lifecycle Rule.
In big data scenarios, parallel file systems usually have deep directory levels and each directory has a large number of files. In such case, deleting directories from parallel file systems may fail due to timeout. To address this problem, you are advised to delete directories in either of the following ways:
- On the Hadoop client that has OBSA, an OBS client plugin, embedded, run the hadoop fs - rmr obs://{Name of a parallel file system}/{Directory name} command.
- Configure a lifecycle rule for directories so that they can be deleted in background based on the preset lifecycle rule.
Deleting Objects from a Bucket with Versioning Disabled, Suspended, or Enabled
Deleting objects may cause data loss. Exercise caution when performing this operation. Versioning can reduce the risk by restoring objects that are accidentally deleted or overwritten.
Scenario |
Deleting the Current Object Version |
Deleting a Noncurrent Object Version |
---|---|---|
A versioning-disabled bucket |
OBS permanently deletes objects. Deleted objects cannot be recovered. |
N/A |
A versioning-suspended bucket |
|
Deleted noncurrent versions cannot be recovered. |
A versioning-enabled bucket |
|
Deleted noncurrent versions cannot be recovered. |
Procedure
- In the navigation pane of OBS Console, choose Object Storage.
- In the bucket list, click the bucket you want to operate to go to the Objects page.
- Select the file or folder you want to delete and choose More > Delete on the right.
You can select multiple files or folders and click Delete above the object list to batch delete them.
- Click OK to confirm the deletion.
If you delete an object from a bucket with versioning enabled, the object is not permanently deleted but retained in the Deleted Objects list. All versions of the object are still kept in the bucket and are billed for storage. If you need to permanently delete the object, complete the following steps:
- Permanently delete a file or a folder from a versioning-enabled OBS bucket:
- Enable Historical Versions.
- Select all the versions of the object to be permanently deleted and click Permanently Delete above the search bar.
Figure 1 Permanently deleting an object
- Click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.