Using Amazon S3 on Ubuntu
From Brandonhutchinson.com
(Difference between revisions)
(New page: == Links == [http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/ How I automated my backups to Amazon S3 using s3sync.]) |
(→''s3sync'' configuration) |
||
| (13 intermediate revisions not shown.) | |||
| Line 1: | Line 1: | ||
| + | I primarily use [http://s3sync.net/wiki s3sync] to interact with my [http://aws.amazon.com/s3 Amazon S3] account, but also install [http://jets3t.s3.amazonaws.com/index.html JetS3t Cockpit] in case I want to use a GUI. | ||
| + | These are my quick-and-dirty notes on setting up ''s3sync'' and ''JetS3t Cockpit'' on Ubuntu Feisty. I referenced the excellent page [http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/ How I automated my backups to Amazon S3 using s3sync] for most of this information; please read that page before proceeding. | ||
| + | |||
| + | == JetS3t Cockpit installation == | ||
| + | $ '''wget https://jets3t.dev.java.net/releases/jets3t-0.5.0.zip''' | ||
| + | $ '''sudo mkdir /opt/jets3t''' | ||
| + | $ '''sudo unzip -d /opt/jets3t jets3t-0.5.0.zip''' | ||
| + | |||
| + | == ''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 ''cockpit.sh'', ''s3cmd.rb'', ''s3sync.rb''. | ||
| + | $ '''cat - << BASHRC >> ~/.bashrc''' | ||
| + | > '''alias cockpit='JETS3T_HOME=/opt/jets3t sh /opt/jets3t/bin/cockpit.sh'''' | ||
| + | > '''alias s3cmd='. /opt/s3sync/s3_variables ; /opt/s3sync/s3cmd.rb'''' | ||
| + | > '''alias s3sync='. /opt/s3sync/s3_variables ; /opt/s3sync/s3sync.rb'''' | ||
| + | > '''BASHRC''' | ||
== Links == | == Links == | ||
| - | [http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/ How I automated my backups to Amazon S3 using s3sync.] | + | * [http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/ How I automated my backups to Amazon S3 using s3sync.] |
| + | * [http://www.khanspot.com/2006/10/31/path-to-ruby-scripts/ Path to Ruby Scripts] | ||
Current revision
I primarily use s3sync to interact with my Amazon S3 account, but also install JetS3t Cockpit in case I want to use a GUI.
These are my quick-and-dirty notes on setting up s3sync and JetS3t Cockpit on Ubuntu Feisty. I referenced the excellent page How I automated my backups to Amazon S3 using s3sync for most of this information; please read that page before proceeding.
Contents |
JetS3t Cockpit installation
$ wget https://jets3t.dev.java.net/releases/jets3t-0.5.0.zip $ sudo mkdir /opt/jets3t $ sudo unzip -d /opt/jets3t jets3t-0.5.0.zip
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 cockpit.sh, s3cmd.rb, s3sync.rb.
$ cat - << BASHRC >> ~/.bashrc > alias cockpit='JETS3T_HOME=/opt/jets3t sh /opt/jets3t/bin/cockpit.sh' > alias s3cmd='. /opt/s3sync/s3_variables ; /opt/s3sync/s3cmd.rb' > alias s3sync='. /opt/s3sync/s3_variables ; /opt/s3sync/s3sync.rb' > BASHRC
