EBS Snapshot using Backup_Monkey

24 / Mar / 2014 by Vikash Jha 3 comments

Getting EBS Snapshot with BackUp Monkey [ a python utility ]

Backup_Monkey :

It’s a command line utility written in python that uses boto library.

Purpose :

  • To create snapshot of all the Elastic Block Storage volume’s (EBS).
  • Automatically detects the volume in the region and take the backup.
  • It is especially designed for Amazon Web Services.
  • It can be scheduled using CRON.

Installation :

Backup_Monkey can be installed easily using “pip” utility . pip is basically a tool for installing python packages.

sudo pip install backup_monkey

Backup_Monkey requires some configuration settings.

Configuration :

This utility uses boto. “boto” is an API written in python, which is used to call AWS resources. Calling AWS resources requires either an IAM user credentials or IAM role with valid resource access. For this purpose, we need to have an IAM user with the EC2 Full Access Policy. You can also customize it according to your needs.

Create a .boto file in your $HOME directory and add the AWS_CREDENTIALS to it :

[Credentials]
aws_access_key_id = <your_access_key_here>
aws_secret_access_key =<your_secret_key_here>

Usage :

$ backup-monkey -help

$ backup-monkey --region us-west-2                   //Replace with your region 

Output :

Backup_Monkey command once runs takes snapshot as well delete an older snapshot. This is configured to keep 3 snapshot/volume and automatically deletes the older one. But this can be changed by changing the default value to whatever you want in the below listed file. It Depend’s on your use case

/usr/local/lib/python2.7/dist-packages/backup_monkey/cli.py

Scheduling CRON for Backup_Monkey :

0 0 * * * /home/ubuntu/script/backup_monkey.sh >> /home/ubuntu/script/backup_monkey.logs 2>&1

Every midnight the backup will be automatically created.

There is one issue with this utility is that it uses a self_prefix value “BACKUP_MONKEY” as snapshot name which you can see in the Output Section which I will be fixing in the next article with the name of your instance instead of self_prefix.

” Use this monkey to automate your backup task ! ” 

FOUND THIS USEFUL? SHARE IT

comments (3)

  1. niefelcowana

    Hey There. I found your blog using msn. That is a really well written article. I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will certainly comeback.

    Reply
  2. przejawiacie

    Hey there I am so grateful I found your website, I really found you by accident, while I was looking on Aol for something else, Regardless I am here now and would just like to say thanks a lot for a incredible post and a all round interesting blog (I also love the theme/design), I don’t have time to browse it all at the minute but I have book-marked it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the superb job.

    Reply
  3. zacieczesz

    A lot of the things you mention happens to be astonishingly legitimate and that makes me wonder the reason why I had not looked at this with this light before. This particular article really did turn the light on for me personally as far as this specific subject goes. Nevertheless at this time there is one issue I am not necessarily too comfortable with and while I attempt to reconcile that with the actual central idea of your position, allow me observe what the rest of the visitors have to point out.Very well done.

    Reply

Leave a comment -