How to remove all files from a Rackspace Cloud Files container
August 3, 2013
I recently switched from Rackspace Cloud Files to Amazon’s S3 due to the high number of read errors I was getting while using Cloud Files. This presented an interested challenge: How am I going to remove all of these containers that are filled with thousands of files? I searched high and low and couldn’t find any code that could automate the entire process. This led me to hunt for a Ruby Library and get to coding! I quickly stumbled upon fog and began to code. Below is a very quick and dirty script to get the job done. I’m hoping that you’ll be able to modify the script below in a few minutes and you’ll be able to easily remove all files from several hundred containers, if not more. The script even has a neat little counter so you know where you are in the whole process.