|
1 | 1 | Backup Monkey
|
2 | 2 | =============
|
3 | 3 |
|
4 |
| -A monkey that makes sure you have snapshots of all your EBS volumes |
| 4 | +A monkey that makes sure you have a backup of your EBS volumes in case something goes wrong. |
5 | 5 |
|
| 6 | +It is designed specifically for Amazon Web Services (AWS), and using Python and Boto. |
| 7 | + |
| 8 | +This script is designed to be run on a schedule, probably by CRON. |
| 9 | + |
| 10 | +Usage |
| 11 | +----- |
| 12 | + |
| 13 | +:: |
| 14 | + |
| 15 | + usage: backup-monkey [-h] [--region REGION] |
| 16 | + [--max-snapshots-per-volume SNAPSHOTS] [--snapshot-only] |
| 17 | + [--remove-only] [--verbose] [--version] |
| 18 | + |
| 19 | + Loops through all EBS volumes, and snapshots them, then loops through all |
| 20 | + snapshots, and removes the oldest ones. |
| 21 | + |
| 22 | + optional arguments: |
| 23 | + -h, --help show this help message and exit |
| 24 | + --region REGION the region to loop through and snapshot (default is |
| 25 | + current region of EC2 instance this is running on). |
| 26 | + E.g. us-east-1 |
| 27 | + --max-snapshots-per-volume SNAPSHOTS |
| 28 | + the maximum number of snapshots to keep per EBS |
| 29 | + volume. The oldest snapshots will be deleted. |
| 30 | + Default: 3 |
| 31 | + --snapshot-only Only snapshot EBS volumes, do not remove old snapshots |
| 32 | + --remove-only Only remove old snapshots, do not create new snapshots |
| 33 | + --verbose, -v enable verbose output (-vvv for more) |
| 34 | + --version display version number and exit |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +Examples |
| 39 | +-------- |
| 40 | + |
| 41 | +Create snapshots of all EBS volumes in us-east-1: |
| 42 | + |
| 43 | +:: |
| 44 | + |
| 45 | + backup-monkey --region us-east-1 |
| 46 | + |
| 47 | +Delete snapshots of EBS volumes in us-west-1 where a volume has more than 5 snapshots: |
| 48 | + |
| 49 | +:: |
| 50 | + |
| 51 | + backup-monkey --region us-west-1 --max-snapshots-per-volume 5 --remove-only |
| 52 | + |
| 53 | + |
| 54 | +Installation |
| 55 | +------------ |
| 56 | + |
| 57 | +You can install Backup Monkey using the usual PyPI channels. Example: |
| 58 | + |
| 59 | +:: |
| 60 | + |
| 61 | + sudo pip install backup_monkey |
| 62 | + |
| 63 | +You can find the package details here: https://pypi.python.org/pypi/backup_monkey |
| 64 | + |
| 65 | + |
| 66 | +Warning |
| 67 | +------- |
| 68 | + |
| 69 | +Make no mistake. This script WILL delete snapshots. This script WILL create |
| 70 | +snapshots, which can cost you money. There really are no warranties or |
| 71 | +guarantees. For costs, refer to http://aws.amazon.com/ec2/pricing/ |
| 72 | + |
| 73 | + |
| 74 | +About Answers for AWS |
| 75 | +--------------------- |
| 76 | + |
| 77 | +This code was written by `Peter |
| 78 | +Sankauskas <https://twitter.com/pas256>`__, founder of `Answers for |
| 79 | +AWS <http://answersforaws.com/>`__ - a company focused on helping business learn |
| 80 | +how to use AWS, without doing it the hard way. If you are looking for help |
| 81 | +with AWS, please `contact us <http://answersforaws.com/contact/>`__. |
| 82 | + |
| 83 | + |
| 84 | +License |
| 85 | +------- |
| 86 | + |
| 87 | +Copyright 2013 Answers for AWS LLC |
| 88 | + |
| 89 | +Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 90 | +not use this file except in compliance with the License. You may obtain |
| 91 | +a copy of the License at |
| 92 | + |
| 93 | +http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable |
| 94 | +law or agreed to in writing, software distributed under the License is |
| 95 | +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 96 | +KIND, either express or implied. See the License for the specific |
| 97 | +language governing permissions and limitations under the License. |
| 98 | + |
0 commit comments