Installing S3CMD on Amazon ServerPosted: April 2, 2012
S3CMD is the command line tool for Amazon that allows you to connect and use S3 storage in the Amazon infrastructure.
The guide as always has some expectation of experience in Linux but where possible does give the commands that are required.
mkdir -p /opt/software
tar xzf s3cmd-1.0.1.tar.gz
yum install -y python-devel
cp -R s3cmd-1.0.1 /opt/s3cmd
python setup.py install
This should install the tool, you know need to configure the software. You will need you AWS access ID and secret key.
Enter the details required. You will then be prompted with some questions
Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: Enter
Path to GPG program [/usr/bin/gpg]: Enter
When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can’t be used if you’re behind a proxy
Use HTTPS protocol [No]: Enter
On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can’t connect to S3 directly
HTTP Proxy server name: Enter
I am usually pretty security conscious and therefore you have to decide on whether you should answer yes to some of the questions, it is all dependent on what you are storing on S3.
How to use the software can be found on the web site of the tool. http://s3tools.org/s3cmd
Some brief commands and examples
s3cmd ls – Lists the buckets
s3cmd ls s3://bucketname/ – will list what is in the bucket note the trailing /
s3cmd put localfilename s3://bucketname/ – will put the file into the bucket
s3cmd put localfilename s3://bucketname/foldername/ –
will put the file into the bucket into a folder name. This will create the folder in the s3 bucket if it does not exist
s3cmd get s3://bucketname/filename local path – will get the file and place it in the local path specified
s3cmd sync s3://bucketname/foldername/ localfoldername/ – syncs the s3 bucket folder to the local folder works much like rsync
s3cmd sync localfoldername/ s3://bucketname/foldername/ – syncs the local folder name to the s3 bucket folder.
s3cmd mb s3://new-bucket-name/ – creates a new bucket