{"id":12411,"date":"2014-03-24T17:58:34","date_gmt":"2014-03-24T12:28:34","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=12411"},"modified":"2014-04-07T16:27:26","modified_gmt":"2014-04-07T10:57:26","slug":"ebs-snaphost-using-backup_monkey","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/ebs-snaphost-using-backup_monkey\/","title":{"rendered":"EBS Snapshot using Backup_Monkey"},"content":{"rendered":"<p><strong>Getting EBS Snapshot with BackUp Monkey [ a python utility ]<\/strong><\/p>\n<p><strong>Backup_Monkey :<\/p>\n<p><\/strong>It&#8217;s a command line utility written in python that uses boto library.<\/p>\n<p><strong>Purpose :<br \/>\n<\/strong><\/p>\n<ul>\n<li>To create snapshot of all the Elastic Block Storage volume&#8217;s (EBS).<\/li>\n<li>Automatically detects the volume in the region and take the backup.<\/li>\n<li>It is especially designed for Amazon Web Services.<\/li>\n<li>It can be scheduled using CRON.<\/li>\n<\/ul>\n<p><strong>Installation :<\/strong><\/p>\n<p style=\"text-align: justify\">Backup_Monkey can be installed easily using \u201cpip\u201d utility . <em>pip<\/em> is basically a tool for installing python packages.<\/p>\n<p style=\"text-align: justify\"><code> sudo pip install backup_monkey<\/code><\/p>\n<p style=\"text-align: justify\">Backup_Monkey requires some configuration settings.<\/p>\n<p><strong>Configuration :<\/strong><\/p>\n<p>This utility\u00a0uses <strong>boto<\/strong>. &#8220;<strong>boto<\/strong>&#8221; is an API written in python, which is used to call AWS resources. Calling AWS resources requires either\u00a0an\u00a0IAM user credentials or IAM role with valid\u00a0resource\u00a0access. For this\u00a0purpose, we\u00a0need to have an IAM user with\u00a0the EC2 Full Access Policy.\u00a0You can also customize it according to your needs.<\/p>\n<p>Create a <strong>.boto<\/strong> file in your <strong>$HOME<\/strong> directory and add the <strong>AWS_CREDENTIALS<\/strong> to it :<\/p>\n<p><code><strong>[Credentials]<br \/>\naws_access_key_id = &lt;your_access_key_here&gt;<br \/>\naws_secret_access_key =&lt;your_secret_key_here&gt;<\/strong><\/code><\/p>\n<p><strong>Usage :<\/strong><\/p>\n<p><code><strong>$ backup-monkey -help<\/strong><\/code><\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/backupmonkey11.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-12428\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/backupmonkey11.png\" alt=\"\" width=\"709\" height=\"378\" \/><\/a><\/p>\n<p><code><strong>$\u00a0backup-monkey --region us-west-2\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 \/\/Replace with your region\u00a0<\/strong><\/code><\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/bm2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-12430\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/bm2.png\" alt=\"\" width=\"709\" height=\"188\" \/><\/a><\/p>\n<p><strong>Output :<\/strong><\/p>\n<p><strong><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/bm3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-12434\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/03\/bm3.png\" alt=\"\" width=\"709\" height=\"50\" \/><\/a><\/strong><\/p>\n<p style=\"text-align: justify\">Backup_Monkey command once runs takes snapshot as well delete\u00a0an older snapshot. This is configured to keep 3 snapshot\/volume and automatically deletes the older one.\u00a0But this can be changed by changing the default value to whatever you\u00a0want in the below listed file. It Depend&#8217;s on your use case<\/p>\n<p><code><strong>\/usr\/local\/lib\/python2.7\/dist-packages\/backup_monkey\/cli.py<\/strong><\/code><\/p>\n<p><strong>Scheduling CRON for Backup_Monkey :<\/p>\n<p><code>0 0 * * * \/home\/ubuntu\/script\/backup_monkey.sh &gt;&gt; \/home\/ubuntu\/script\/backup_monkey.logs 2&gt;&amp;1<br \/>\n<\/code><br \/>\nEvery midnight the backup will be automatically created.<br \/>\n<\/strong><\/p>\n<p>There is one issue with this utility is that it uses a <span style=\"color: #ff0000\">self_prefix<\/span> value <span style=\"color: #ff0000\">&#8220;BACKUP_MONKEY&#8221;<\/span> 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 <span style=\"color: #ff0000\">self_prefix.<span style=\"color: #000000\"><\/p>\n<p>&#8221;\u00a0Use this monkey to automate your backup task ! &#8221;\u00a0<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting EBS Snapshot with BackUp Monkey [ a python utility ] Backup_Monkey : It&#8217;s a command line utility written in python that uses boto library. Purpose : To create snapshot of all the Elastic Block Storage volume&#8217;s (EBS). Automatically detects the volume in the region and take the backup. It is especially designed for Amazon [&hellip;]<\/p>\n","protected":false},"author":100,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1},"categories":[1174],"tags":[572,1172,473,1358],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/12411"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=12411"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/12411\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=12411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=12411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=12411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}