Amazon’s cloud storage system s3 is a pretty useful online service. It’s really cheap and has lots of features, although its a little bit more difficult to use than something like dropbox. You can access some of the features from the linux command line, using the s3cmd program. I wanted to do this so I could easily check the total size of all my buckets (sort of like folders in s3). Here’s how to install s3cmd on your Raspberry Pi:
I’m assuming you already have an s3 account (see AWS for details), that you have your access key and secret key available, and that you’re using the Raspbian distro. Since this is based on Debian, we can get the s3cmd from the Debian repositories – but we’ll need to access the experimental one:
1. First add the experimental repository to your sources:
sudo nano /etc/apt/sources.list
add the line at the end of the file
deb http://ftp.debian.org/debian experimental main
save and close the file (Ctrl-X and Y) andthen get the updates list
sudo apt-get update
2. To install, we need to use a slighted modified version of apt-get:
sudo apt-get -t experimental s3cmd
3. Next we need to set up s3cmd so it can connect to our personal AWS s3 account. Here you’ll need your AWS ID and Secret Key. Most of the options are fairly obvious.
s3cmd --configure
4. The actual command to get the size of a bucket is pretty easy:
s3cmd du s3://my-bucket-name
If you want the full list of commands for s3cmd to manage all your s3 resources, check out the following pages:
How to Guide for basic usage of s3cmd: http://s3tools.org/s3cmd-howto
Using the Debian Experimental Repo: https://wiki.debian.org/DebianExperimental