Painless Amazon EC2 Backup
The past year on Amazon EC2 has taught me many things but first and foremost is back up consistently. I’ll say it again, back up consistently! Amazon even makes the backup almost painless, almost…
Amazon has EC2 (the compute cloud) and S3 (the data repository). Out of the box you can back up from EC2 to S3 using simple Amazon provided scripts like ec2-bundle-vol and ec2-upload-bundle. They both come already installed with the Linux images you start with.
I’ll inject some philosophy here. Some people believe that backing up the entire image is a waste of resources and you should instead back up only the data you need to S3. These people obviously have copious amounts of spare time on their hands. I’m not going to cry over the extra few MB, the benefit is being able to restore a backup in 30 automated seconds vs. twiddling with buckets and databases. Time is money.
The idea behind the code below is to backup entire images of a server on a rotating daily schedule. Rotation is set to create a unique manifest in your bucket per day of the week. If the system goes down or is compromised pick a backup day to restore, relaunch the instance from that image, and re-assign your Amazon IP address. The whole restore process should take no more than 30 seconds (Not counting instance boot).
To implement this backup strategy simply copy the following script into /root/backup.py and set up the following cron task (midnight backup):
crontab -e
0 0 * * * /root/backup.py
All codes above are fake but you should replace them with your own. Run the script manually or run it using the cron. Either way you get an automated painless Amazon EC2 backup.
More from Aware Labs
- Everything A Django Developer Needs To Create Logins
- Amazon EC2 Basics For The Curious
- When Django Apps Grow Up
- Goodbye WebFaction Django Hosting – A Reflection
- Porting Aware To Django
Aware Labs Recommends
- WordPress For Business (The Arkayne Blog)
- Popularizing Django — Or Reusable apps considered harmful. (USwaretech)
- On Cloud 9 With Amazon EC2 (The Arkayne Blog)
-
Ja
-
pkenjora
-
Android Blog
-
Darren
-
Alejandro
-
thom
-
Ezra Klughaupt
-
arpitjain
-
Dominic Watson
-
Conrad Decker
-
Conrad Decker
-
Press Controls
-
automated production
-
danb
-
Odzyskiwanie Danych
-
Jonathan Fine
-
Rajesh D
-
Nick
-
Rajesh D
-
pkenjora
-
Rajesh D
-
Nick
-
Mike Parsons
-
pkenjora
-
HW
-
pkenjora
-
pkenjora

![Recommend [AwareLabs]](http://s3.amazonaws.com/arkayne-media/img/badge/logo-recommend-badge-medium.png)