Today sees a new release of Cliaws. This is a simple library to interact with S3 (and other services) through the command-line. This library is very similar to Amazon’s own ec2-* scripts, except this library is written in Ruby.

Interacting with S3 should be no harder than:


1 $ clis3 put my-local-file my-bucket/my-s3-file

Put many files at once:


1 $ clis3 put my-local-file0 my-local-file1 my-bucket/my-s3-directory/

Put an environment variable:


1 $ clis3 put —data $MY_DATA my-bucket/my-env-value

Put stdin too!


1 $ tar czfv /var/cache/mylvmbackup/backup | clis3 put – my-bucket/my-backup/backup-20080825-000000.tar.gz

All of this functionnality is available from with Ruby too:


1 require "rubygems"
2 require "cliaws"
3
4 Cliaws.s3.put("this is the content", "my-bucket/my-s3-file")
5 File.open("my-local-file", "rb") do |io|
6 Cliaws.s3.put(io, "my-bucket/my-s3-file")
7 end

Give the RubyForge gem servers a couple of hours to refresh themselves, and then enjoy!

I just pushed 1.2.0 to GitHub as well as RubyForge. This release has a single major improvement:


1 $ clis3 put A B local/C bucket/dir/
2 A => bucket/dir/A
3 B => bucket/dir/B
4 local/C => bucket/dir/C

put isn’t yet recursive, and note the caveat above: all paths are flattened to their basenames. Enjoy!

Links

Search

Your Host

A picture of me

I am François Beausoleil, a Ruby on Rails and Scala developer. During the day, I work on Seevibes, a platform to measure social interactions related to TV shows. At night, I am interested many things. Read my biography.

Top Tags

Books I read and recommend

Links

Projects I work on

Projects I worked on