How to empty an Object Storage Bucket
This blog post will teach you how to easily empty all objects from an object storage bucket to get it ready for deletion.
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.
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:
Note: This is currently the best method to empty object storage buckets that have archiving enabled.