AWS EC2 Linux backup

There is awesome Amazon Linux AMI, I think it is the most popular image that used for creating EC2 across all AWS regions. In fact you read / watch about it in every single tutorial / education course. I can just agree with all listed key features of it, but personally want to admit the following:

AWS EC2 Linux backup

  • Lightweight. Indeed, it’s super small and contains just really basic. In free tier it is supplied by GP2 8GiB (General Purpose SSD with up to 3000 IOPS) and for daily tasks that should be fine;
  • Comes with built-in AWS CLI. This is what I really love! In few clicks with IAM role assigned ( (!!!) do NOT forget to do this launching your instance, otherwise you’ll miss that huge piece of Amazon);
  • Stable and the most reliable. This might be just my opinion, but as it is driven by Amazon and community, it should be the most robust and mature.

The launch part should be super simple and in most cases people just follow the wizard (keep your pem key in the right place and chmod it to the lowest number you can). There are different use cases people have with this image (from hosting PBX to SQL / noSQL DBs or webservices with Apache / Nginx etc). It’s all about data actually and data should be saved and recoverable.

Cloudberry Backup for Linux and it comes with nice command line interface (CLI), what is really important (IMHO, in most cases admins run it without UI). Ok! The best way to get the software is to download it from CBL website and upload to one of bucket in your AWS S3 service (even through web interface, as it is just one file).

Amazon Linux is actually based on RHEL 5.x and 6 (partially). Go with Red Hat 6.x here.

Now, SSH to your Linux using the following:

ssh ec2-user@public_IP_of_linux_instance -i /path/to/your/pem-file

ec2-user - default user that should be used for remote SSH (you may want to reconfigure it once production), pem-file is the one you download when creating public key (don’t loose it and make sure chmod 600 your.pem).

As you have AWS CLI built-in (check this nice video from re:Invent 2015) you actually can work with all AWS services. Let’s try it out and output something:

aws s3 ls
2016-09-14 11:05:28 erudinsky-s3
2016-08-07 15:57:25 evgenyrudinsky
aws s3 ls s3://erudinsky-s3
2016-09-14 11:05:49   45135196 rh6_CloudBerryLab_CloudBerryBackup_v1.9.0.16_20160810193949.rpm

Perfect! We can see objects in our buckets! And this is not all! We can also create, update and remove!

aws s3 cp s3://erudinsky-s3/rh6_CloudBerryLab_CloudBerryBackup_v1.9.0.16_20160810193949.rpm /home/ec2-user/

We just copied rpm file (installed package of my CBL Backup for Linux) across to home directory of our default user! Let’s install this package quickly! It is very important to set this --nodep flag, that will skip all required dependencies for graphic interface and add all CBL daemons accordingly.

rpm -i rh6_CloudBerryLab_CloudBerryBackup_v1.9.0.16_20160810193949.rpm
error: Failed dependencies:
	libGL.so.1()(64bit) is needed

We just tried wrong way. Let’s add the flag! Install the software and activate license (BTW, there is totally FREE version available).

rpm -i rh6_CloudBerryLab_CloudBerryBackup_v1.9.0.16_20160810193949.rpm --nodeps
cbb activateLicense -e "yourname@yourdomain.com" -free -un yourname
cbb activateLicense -e "yourname@yourdomain.com" -free -oa "received random key"
CloudBerry Backup Command Line Interface started

We are done! Let’s configure accont (any from the list of 20+ providers, but let’s do this to S3 storage provide (Infrequent Accessed Data).

cbb addAccount -d erudinsky-s3 -st AmazonS3 -ac <access_key> -sk <secret_key> -c erudinsky-s3 -ssl
cbb account -l
CloudBerry Backup Command Line Interface started
erudinsky-s3 : AmazonS3
cbb addBackupPlan -n "files" -a "erudinsky-s3" -f /home/ec2-user/files/" -c yes -notification on
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy