Using Amazon S3 on Ubuntu

From Brandonhutchinson.com

(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
$ '''sudo tar zxvf s3sync.tar.gz -C /opt/'''
$ '''sudo tar zxvf s3sync.tar.gz -C /opt/'''
$ '''sudo chmod go-w /opt/s3sync'''
$ '''sudo chmod go-w /opt/s3sync'''
-
$ '''( DIR=`mktemp -d` ; cd $DIR ; wget http://mirbsd.mirsolutions.de/cvs.cgi/~checkout~/src/etc/ssl.certs.shar ; '''sh ssl.certs.shar ; sudo mv f73e89fd.0 /opt/s3sync ; cd .. ; rm -r $DIR )'''
+
$ '''( DIR=`mktemp -d` ; cd $DIR ; wget http://mirbsd.mirsolutions.de/cvs.cgi/~checkout~/src/etc/ssl.certs.shar ;
 +
'''> sh ssl.certs.shar ; sudo mv f73e89fd.0 /opt/s3sync ; cd .. ; rm -r $DIR )'''
== ''s3sync'' configuration ==
== ''s3sync'' configuration ==
-
$ '''sudo sh -c 'echo "AWS_ACCESS_KEY_ID=''AWS_ACCESS_KEY_ID''\nAWS_SECRET_ACCESS_KEY=''AWS_SECRET_ACCESS_KEY''\n
+
$ '''sudo sh -c 'cat - << S3_VARIABLES > /opt/s3sync/s3_variables'''
-
'''RUBYLIB=$RUBYLIB:/opt/s3sync\nSSL_CERT_DIR=/opt/s3sync" > /opt/s3sync/s3_variables''''
+
> '''export AWS_ACCESS_KEY_ID=''AWS_ACCESS_KEY_ID'''''
 +
> '''export AWS_SECRET_ACCESS_KEY=''AWS_SECRET_ACCESS_KEY'''''
 +
> '''export RUBYLIB=$RUBYLIB:/opt/s3sync'''
 +
> '''export SSL_CERT_DIR=/opt/s3sync'''
 +
> '''S3_VARIABLES'''
$ '''sudo chmod 400 /opt/s3sync/s3_variables'''
$ '''sudo chmod 400 /opt/s3sync/s3_variables'''
$ '''sudo chown ''your_user_ID'' /opt/s3sync/s3_variables'''
$ '''sudo chown ''your_user_ID'' /opt/s3sync/s3_variables'''
 +
 +
I use aliases for ''s3cmd'' and ''s3sync''.
 +
$ '''cat - << BASHRC >> ~/.bashrc'''
 +
> '''alias s3cmd='. /opt/s3sync/s3_variables ; /opt/s3sync/s3cmd.rb''''
 +
> '''alias s3sync='. /opt/s3sync/s3_variables ; /opt/s3sync/s3sync.rb''''
 +
> '''BASHRC'''
== Links ==
== Links ==

Revision as of 15:47, 11 October 2007

s3sync installation

$ sudo apt-get -y install ruby libopenssl-ruby
$ wget http://s3.amazonaws.com/ServEdge_pub/s3sync/s3sync.tar.gz
$ sudo mkdir /opt/s3sync
$ sudo tar zxvf s3sync.tar.gz -C /opt/
$ sudo chmod go-w /opt/s3sync
$ ( DIR=`mktemp -d` ; cd $DIR ; wget http://mirbsd.mirsolutions.de/cvs.cgi/~checkout~/src/etc/ssl.certs.shar ;
> sh ssl.certs.shar ; sudo mv f73e89fd.0 /opt/s3sync ; cd .. ; rm -r $DIR )

s3sync configuration

$ sudo sh -c 'cat - << S3_VARIABLES > /opt/s3sync/s3_variables
> export AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID
> export AWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY
> export RUBYLIB=$RUBYLIB:/opt/s3sync
> export SSL_CERT_DIR=/opt/s3sync
> S3_VARIABLES
$ sudo chmod 400 /opt/s3sync/s3_variables
$ sudo chown your_user_ID /opt/s3sync/s3_variables

I use aliases for s3cmd and s3sync.

$ cat - << BASHRC >> ~/.bashrc
> alias s3cmd='. /opt/s3sync/s3_variables ; /opt/s3sync/s3cmd.rb'
> alias s3sync='. /opt/s3sync/s3_variables ; /opt/s3sync/s3sync.rb'
> BASHRC

Links

Personal tools