Announcing ec2-extra-tools

by Carl Mercier

Hola!  I just started a new project on GitHub, I’m calling it ec2-extra-tools.  It’s basically a set of extra command line tools that I find useful on Amazon EC2. Right now, it only has 2, but I will add more in the future and encourage other people to collaborate on the project.

Here’s what’s included so far:

  • ec2-identify-instance: returns the current EC2 instance id
  • ec2-identify-volume: returns the EBS volume id of a device

I needed ec2-identify-volume to automate EBS snapshots, so I thought I’d release my work on GitHub.

Here’s what I added in /etc/crontab to automate EBS snapshots:

0 2 * * * root ec2-create-snapshot `ec2-identify-volume /dev/sdj` >> /var/log/ebs_snapshots

The great thing about this line is that I don’t need to know the volume id beforehands. If a new volume is attached at /dev/sdj, I don’t have to change my crontab file either. In my situation, this is very convenient.

Hope you find ec2-extra-tools useful!