Backup MySQL to Google Drive

I always had this issue when i started to working on new projects where do i keep my MySQL backup data, if i keep backup data same server as my application running it’ll soon consume all disk space just for backup data. So I wanted to find a solution for this.

 

Cloud Hosting providers tend to charge extra fees if you want to enable automated backups or there might be terms which you don’t like. I think most of startups/individual projects don’t want to spend too much money on their backups or may be funding might be limited.

I’ve look around for cheap but reliable service for this, The solution I’ve came across is to use Google Drive as my backup storage which has fair prices to increase storage(if needed, otherwise stick to free storage limit), reliable and highly available. Also there’s a well documented API available for this service.

I’ve used python for all background work for this task, then it’ll upload file straight to Google Drive.

Installation and help guide available on https://github.com/KasunDon/google-drive-mysql-backup

Feel free to give me a feedback or report any issues.

Login to AWS EC2 instances

Recently I’ve started to use AWS (Amazon Web Services) to host few of my web apps. I’ve had a little hard time to figure out how to access instances using *.pem file associated while i was creating AWS Instance.

First of all, locate pem file and assign appropriate permissions to it.


chmod 400 /path/my-key-pair.pem

Then depending upon OS (Operating System) of your ec2 instance you’ve created, you’ve to access appropriate user in order get into your ec2 instance.

Amazon Linuxec2-user
RHEL5root | ec2-user
Ubuntu – ubuntu
Fedora – fedora | ec2-user
SUSE Linux – root | ec2-user

All Others OS’s – root | ec2-user  or check with your AMI provider.

user_name@public_dns_name

For Example
ssh -i /path/my-key-pair.pem ec2-user@ec2-121.compute-1.amazonaws.com

More information please refer to AWS Official User Guide.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html