Deleting nearline storage via gsutil
13 Jul 2016In order to save some cash after seeing some recurring Google invoices for their nearline storage buckets prompted me to realise that I was paying for storage that was essentially just a test of what I at the time considered to be a match for Amazon’s S3 and Glacier storage.
Now they do have a nice console web app and an iOS app to manage these but attempts at deleting my buckets of data did not work.
Probably due to the size of the storage.
So, a quick search and I found they have a CLI SDK which would enable me to run a delete command from the Mac Terminal.
The following are instructions for Mac but the docs should cover others including windows.
- Download the Python package
- Extract it to a folder in your home directory such as
~/google-cloud-sdk
- Run the install script
./google-cloud-sdk/install.sh
- Initialize the SDK
./google-cloud-sdk/bin/gcloud init
Welcome! This command will take you through the configuration of gcloud.
Your current configuration has been set to: [default]
To continue, you must login. Would you like to login (Y/n)?
- Follow the rest of the setup and then once you have chosen the project that contains the bucket you want to delete you can run the following command however do note this will delete all your data so do know that is what you are doing here!
$ gsutil rm -r gs://INSERT-NAME-OF-BUCKET/
And this is what you should see :