Monday, October 10, 2011

Backup your Amazon Cloud Free Tier Linux Server

Warning: Unfinished

Backups

http://blog.awarelabs.com/2009/painless-amazon-ec2-backup/
http://aws.amazon.com/account/

amazon > s3 > create bucket > backups.YOURDOMAIN.com > us standard > create

http://www.labnol.org/internet/tools/amazon-s3-simple-storage-service-guide/3889/ -- Now go to AWS Access Key Identifiers and generate a unique Access Key ID + Secret Access Key pair that is required for using Amazon S3.

Okay, at some point above, lost in the record, I generated:

D:\web\aws\_account\AccessIdentifiers
 cert-################################.pem
 pk-################################.rar -- which is just a password protected pem

Put these onto the box in plaintext. By which I mean, use winrar to unrar the .rar to a plaintext .pem and use winscp to transfer both the cert.pem and the pk.pem to the amazon box. Anyone who breaks into your box will have access to these and hence to amazon services for which you can be billed, so give them weird names and put them in weird locations.

sudo mkdir /SECRET_LOCATION
sudo chown ec2-user:ec2-user /SECRET_LOCATION
sudo chown root:root /SECRET_LOCATION
sudo chown root:root /SECRET_LOCATION/*
sudo chmod 500 /SECRET_LOCATION
sudo chmod 400 /SECRET_LOCATION/CERT_FILE_NAME
sudo chmod 400 /SECRET_LOCATION/KEY_FILE_NAME

I didn't finish this.
http://docs.amazonwebservices.com/AmazonEC2/dg/2006-10-01/CLTRG-ami-bundle-vol.html
http://code.google.com/p/s3fs/wiki/FuseOverAmazon

ec2-bundle-vol -k PRIVATE-KEY
               -u USER-ID
               -s SIZE
               [-d DESTINATION-DIR]
               [-e EXLCUDE-DIR-1,EXCLUDE-DIR-2...]
               [-p AMI-PREFIX]
               [-v VOLUME] 

    step_2 = '%sec2-bundle-vol -p %s -d /mnt -k %s -c %s -u %s -r %s' % (ec2_path, manifest, pem_file, cert_file, user_id, platform)  
aws
{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "Steps required to setup automatic backups of your Amazon Linux Image on the AWS Free Tier.", "page": { "blogIds": [ 54 ] }, "domain": "holtstrom.com", "base": "\/michael", "url": "https:\/\/holtstrom.com\/michael\/", "frameworkFiles": "https:\/\/holtstrom.com\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/holtstrom.com\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/holtstrom.com\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/www.themoviedb.org\/", "tmdbPoster": "http:\/\/image.tmdb.org\/t\/p\/w342" }