Amazon’s S3 service provides solid, fast and cheap storage. If you’re like me, you want to use it to backup data–lots.
Every night, I make a backup of bradkovach.com and some other websites. The script begins at 11:00 MST, gathers all the information that my website needs to survive, bundles it up, and sends it to a remote server. By “remote” I mean, “in my Mom’s laundry room, connected to sub-standard broadband.”
The process takes about eight hours–due to the slow connection.
Also, the server’s hard drive fills up quickly, so it can barely hold a week’s worth of backups–not enough. But still, having the backup has been beneficial. Just a few days ago, I ruined a client’s website (while the client was there) with some trigger-happy deletions. The backup saved my day.
But when I needed to restore the backup, it took HOURS. I thought–there has to be a better way. And there was…
Everyone who has the Internet is familiar with Amazon.com, the Wal-Mart of the online world. They’ve taken shopping to a whole new level by making it affordable and easy.
Amazon has amazing infrastructure that keeps their site running. The same infrastructure has been made available to end-users who want simple, solid, affordable storage.
At its core, S3 is a very simple file system. S3’s structure includes buckets and objects. Buckets are like folders. Within a bucket, you can place objects.
Each S3 account allows 100 buckets. Each bucket can hold unlimited objects. Within buckets, you may not create folders, rename, move, copy or modify files. Within buckets, you may store data–lots of it–and cheap, too!
If you have a *nix server that needs regular backups, S3 is a perfect solution.
The only downside? It’s kinda tricky to maneuver. But I’ve figured it out! You can too.
There are a number of approaches. Most involve programs, compiling, and administrative access to the machine they run on. I don’t have administrative access to my webserver (thank goodness)–so this solution is shared-hosting friendly. You only need shell access to make this work.
That should do it. You can easily work this into scripts. My script compiles a folder, tar/gzips it and then uploads it to Amazon S3 and then (for some odd reason), I still upload to my little server that could.
Using s3-bash, we can retrieve files from Amazon S3 as well. Assuming you have followed the above steps to upload to Amazon S3, the following command will retrieve from S3.
~/s3/s3-get.sh -S -k ACCESSKEYID -s ~/s3/aws_key /BUCKET/NAMEDOBJECT > FILEtoSAVE
Fast - I can backup in MINUTES instead of HOURS. Inversely, I can restore a backup in MINUTES, too.
Reliable - Amazon has multiple copies of all of my data–in multiple geographic locations.
Cheap - I estimate that I’ll be paying three dollars a month to maintain a month’s worth of backups.
Brad Kovach is an award-winning web developer from Afton, Wyoming. In his spare time, he enjoys drumming on Rock Band, and playing with this website.
© Brad Kovach and Friends 2004-2010 | Powered by Wordpress | Log in
Brad Kovach and friends is a website made by friends for the world's enjoyment. We like computers, art, having fun, and sharing! We try to keep things G-rated, but we're all adults–so take that for what it's worth. This page took 26 queries and 0.766 seconds of computer labor to produce.