How to empty an Object Storage Bucket
This blog post will teach you a number of ways to easily empty all objects from an object storage bucket to get it ready for deletion.
Via RONIN - Recommended!
- Just click the 3 dots in the top right hand corner of your object storage bucket in RONIN and select "Empty Store"
- RONIN will give you the option to either keep your bucket once it is emptied, or delete the bucket once it is empty
- Object storage buckets can take a few days to completely empty - while they are being emptied your bucket will show an emptying status and whether the bucket will be kept or deleted
- You will no longer be able to configure archiving or versioning rules when emptying a bucket and any previous rules will be removed on empty
Via Cyberduck
If you only have a small number of objects/files (i.e. in the order of hundreds or less) in your object store, and you have already connected Cyberduck to your object store, you can quickly and easily delete all objects using Cyberduck. Once inside your object store, just navigate to Edit > Select All and then right click and select Delete.
Via the AWS CLI
For object stores with many files (i.e. thousands or more), or large files, it is recommended to use the AWS CLI to empty your object store. Once you have installed the AWS CLI tools and configured your object store, you can easily delete all objects via the following command, replacing mybucket
with the path of your object store (this can be found from the object storage screen in RONIN).
aws s3 rm s3://mybucket --recursive
Note: Object stores with large volumes of data can sometimes take several hours to empty. We recommend using a screen session to run the above command if you have many files or large files in the object store as this will prevent the deletion process being interrupted. Using a larger machine where the AWS CLI tool can take advantage of multiple CPUs can also help.
Via the AWS Console
If you are an Administrator and have access to the AWS Console, you can easily empty an object store by navigating to S3 in the console, selecting your desired object stores and clicking Empty: