Hoopla!

now with extra whiz-bang!

Hoopla!

Amazon S3 Backup via Rails Plugin

January 02, 2007 · 9 comments

I think Amazon S3 is awesome. I was looking into building a RAID NAS (Network-Attached Storage) for backing up all my important data and I nearly bought a setup that would run into the hundreds of dollars - but then I did a little fancy multiplication and addition and realized S3 would cost me less than one one-hundredth what the NAT would have cost.

In case you’re as in the dark about S3 as I recently was, here’s a little rundown: it’s a very simple, super fast, extremely large backup system that Amazon uses for all of it’s own storage needs. It’s opened the service up to the public on a pay-as-you-go basis.

Costs:

  • $0.15 per GB-Month of storage used
  • $0.20 per GB of data transferred

In other words, it’s damn cheap. Say you want to upload 500 MS Word documents that are around 45KB each? How much would it cost to store those on some easy-to-access, highly secure, permanent backup place? Less than one cent per month. Eight years later you’d only be out a half-dollar ($0.32 to be precise).

So S3 is my new storage/backup location of choice. The one difficulty of using it is that I need to figure out some way of automating the backups so that the backups are actually useful and can easily be recovered if necessary. In particular, I need some way to automatically backup the website data that is so crucial to me.

So I made a plugin.

The S3 plugin will allow you to backup your crucial website data to S3 via a handy Rake task (written by the talented Adam Greene).

Amazon has been an excellent supporter of Ruby/Rails lately (they fund 43things.com among other things) and they’ve made sure to release a ruby library for S3. I’ve combined that with Adam’s S3 rake task into a handy S3 backup plugin.

You can install it via the following two commands:

1
2
ruby script/plugin source http://svn.6brand.com/projects/plugins
ruby script/plugin install -x s3

Then backing up is easy as:

1
2
3
rake s3:backup:db
rake s3:backup:code
rake s3:backup:scm

or, to get them all together:

1
rake s3:backup

→ 9 comments Tags:

Installing Mephisto on DreamHost

August 19, 2006 · 2 comments

I’ve tried out Typo for a while and it’s pretty nice but I’m hearing raves about Mephisto. I’m sheep-like enough to always follow coding trends so I can’t see any way out of trying Mephisto on for size.

The first thing that I saw on the installation instructions was that it doesn’t ship with all the required parts. You’ve got to check out Rails to the vendor directory (easy enough) and add at least one gem.

Adding the TZinfo (‘time-zone info’) gem proved a pain so I just downloaded it from it’s rubyforge project and throw it into my vendor directory
cd rails_app/vendor
wget http://rubyforge.org/frs/download.php/11738/tzinfo-0.3.0.tar.gz
tar xvzf tzinfo-0.3.0.tar.gz
rm tzinfo-0.3.0.tar.gz

A little migration, replacing the default .htaccess and dispatch.fcgi files with my customized ones, some short prayers that this process goes quickly and I don’t screw away my whole day on something I didn’t even plan to do, and it’s all done. Except that it’s not.

I’m not sure if this is the new cool thing to do or if it’s just a bad choice supported for legacy reasons, but you can’t use migrations on a fresh mephisto database. You’ve got to type `rake db:bootstrap` and it creates the tables and throws some default values in there. I’d prefer migrations, but whatever. At least it got done.

My first impressions are good, we’ll see how it goes finding a good theme.

→ 2 comments Tags: