Amazon EC2 AMI-Bundling Script for Linux Servers
During the course of a recent project, I needed to make an automated backup system, instead of re-inventing the wheel and creating a full blown backup management application I simply created several scripts to perform the backups to S3 storage, the one I’m releasing here is for automatically bundling your server up, uploading the bundle files to S3 and then registering the new AMI with Amazon AWS Console for you to launch later. It adds todays date to the end of the AMI bundle files and cleans up after itself, so it is quite feasible to use this in a cron script that’s run on a regular basis, or it can simply be used as a one off, run it manually and don’t worry about it kind of script.
If you use the file, you’ll need to edit the variables at the top of the script, I’ve annotated it and tried to explain them clearly in plain English, but in short they are for your Amazon EC2 and S3 certificates and keys which you should have received when signing up for the services, file locations and names and paths to the EC2 tools and Java executable.
You’ll also need to make sure you have the FULL set of EC2 api tools on your server, not just the basic ones that come with the server by default. You can get the full set of Java tools from the Amazon EC2 Resource Center.
I still haven’t created a download file to manage downloads so please remember the following link will change, if you choose to give it out to others for download, please give them the link to this page instead, I will update the link as and when required.
For now you can get the tar file from here:
Automate-Amazon-EC2-Bundle-Server-V.1.0.0.tar.gz
Please note this script is only tested on an Ubuntu 8.10 Server so far, I’d appreciate anyone who has it working on a different OS letting me know so I can add it to the compatibility list here. If anyone has any additions to this that could be useful to others, I’d appreciate you letting me know in the comments.
**Please note, there is NO error handling in this script at the moment, later versions may perform directory checks and error handling if they are needed, but for now you will simply have to make sure that you get your directory paths correct or the script will fail**
Categories:
Tags: |
Site Navigation
Recent Posts
Thanks for your script. It is really useful to bundle
I’m glad you found it useful, and thanks for letting me know