• feedburner RSS feed
  • About
  • lifestream
  • Site Tech
  • Blog moved to Amazon EC2

    I decided to move my blog, and some other services I run, to Amazon EC2. I have had nothing but excellent service from the current hosting company, Rimu Hosting where I have a VPS, however I want to see how reliable EC2 really is in practice.

    I don’t yet have access to persistent storage on EC2, so I cobbled together a quick paranoid hourly data dump of critical files to my S3 account. Investigated a few different S3 backup options, settled on a quick and dirty.

    I really wanted to use s3fs to simply mount my S3 bucket using FUSE and then use rsync to manage my backups. However, I am running Debian Etch in EC2 and even with the backports version of the FUSE libs, and the Amazon supplied 2.6.16 kernel, I was unable to load the kernel fuse module as it appears to be compiling a module version which doesn’t like the running kernel.

    So I simplified it and wrote my own script in a few minutes. I don’t have much data at all to backup, if you have any meaningful amount of data then you need a more intelligent system than this.

    Here is my EC2 -> S3 backup script. Ugly, but works (for me).
    You need s3sync for this to work.


    #!/bin/bash
    #SETTING 1: what directories to backup
    BACK_THESE_UP="/root /etc /mnt/backup/apps /mnt/backup/backups /mnt/web"
    #SETTING: where to create local tarballs
    BACKUP_TO_BASE=/mnt/backup/snapshots
    #SETTING: time format used in filenames
    THETIME=`/bin/date +%m-%d-%y--%H:%M:%S`
    # ACTION: manual, paranoid MySQL dump
    mysqldump --all-databases -u YOUUSER --password=YOURPASS > /mnt/backup/backups/mysql/manual/$THETIME.sql
    gzip /mnt/backup/backups/mysql/manual/$THETIME.sql
    # ACTION: create our backup tarball
    tar -zcvf $BACKUP_TO_BASE/$THETIME.tar.gz $BACK_THESE_UP
    # ACTION: put that tarball on S3
    /mnt/backup/apps/s3sync/s3cmd.rb --ssl put YOURBUCKETNAME:$THETIME.tar.gz $BACKUP_TO_BASE/$THETIME.tar.gz

    Technorati Tags: WordPress, EC2, Amazon, AWS

    By: warwick, on: Apr 27, 2008
    Tagged with: backups, ec2, fuse

    Post a Comment


    Tag Cumulonimbus

    amazon apple automattic browsers cache color conference craigslist ec2 ex720 fuel funny images iphone linux LIRR mac macbook pro mysql nginx nventory NY nyc osx packages photographs politics proxy rails rant rpm s3 silly software south africa squid startups stubhub svn travel web 2.0 wordpress wp-themes youtube zimbabwe

    Twitter: warwickp

    • WordPress.com is a few mili seconds away from 2.7... 6 hrs ago
    • WordPress 2.7 is creeping closer and closer.... 7 hrs ago
    • Not that I used Pownce, or care that much, but it would seem the right thing to do would be to open source Pownce and let it live on. 2 days ago
    • Michael Clayton is my favorite movie of the last 5 years. 4 days ago
    • More updates...

    Powered by Twitter Tools.

    A blog by Warwick Poole
    Powered by:
    WordPress and more.