answers4aws / backup-monkey Goto Github PK
View Code? Open in Web Editor NEWA monkey that makes sure you have snapshots of all your EBS volumes
License: Apache License 2.0
A monkey that makes sure you have snapshots of all your EBS volumes
License: Apache License 2.0
Add a way to filter which EBS volumes and snapshots Backup Monkey operates on. This could be useful to only snapshotting a subset of your volumes, rather than all of them.
The only filter I can think right now is by Tag key/value pairs.
When creating or deleting a lot of snapshots backup-monkey crashes when the requests to AWS fail because the request limit is reached.
It should catch the error and try again with a lower rate.
`Traceback (most recent call last):
File "/usr/local/bin/backup-monkey", line 9, in
load_entry_point('backup-monkey==1.0.0', 'console_scripts', 'backup-monkey')()
File "/usr/local/lib/python2.7/dist-packages/backup_monkey-1.0.0-py2.7.egg/backup_monkey/cli.py", line 103, in run
monkey.remove_old_snapshots()
File "/usr/local/lib/python2.7/dist-packages/backup_monkey-1.0.0-py2.7.egg/backup_monkey/core.py", line 150, in remove_old_snapshots
snapshot.delete()
File "/usr/local/lib/python2.7/dist-packages/boto-2.38.0-py2.7.egg/boto/ec2/snapshot.py", line 97, in delete
return self.connection.delete_snapshot(self.id, dry_run=dry_run)
File "/usr/local/lib/python2.7/dist-packages/boto-2.38.0-py2.7.egg/boto/ec2/connection.py", line 2501, in delete_snapshot
return self.get_status('DeleteSnapshot', params, verb='POST')
File "/usr/local/lib/python2.7/dist-packages/boto-2.38.0-py2.7.egg/boto/connection.py", line 1213, in get_status
response = self.make_request(action, params, path, verb)
File "/usr/local/lib/python2.7/dist-packages/boto-2.38.0-py2.7.egg/boto/connection.py", line 1116, in make_request
return self._mexe(http_request)
File "/usr/local/lib/python2.7/dist-packages/boto-2.38.0-py2.7.egg/boto/connection.py", line 1028, in _mexe
raise BotoServerError(response.status, response.reason, body)
boto.exception.BotoServerError: BotoServerError: 503 Service Unavailable
RequestLimitExceeded
Request limit exceeded.7fba627b-7ab4-4b1f-85a4-cde7193d086b
`
I was running the cleanup process and then was hit with this following error -- any ideas of how to get around this?
Deleting snap-9a471c8f: BACKUP_MONKEY vol-a7444947 i-8b77965c /dev/xvda
Traceback (most recent call last):
File "/usr/local/bin/backup-monkey", line 9, in
load_entry_point('backup-monkey==1.0.0', 'console_scripts', 'backup-monkey')()
File "/usr/local/lib/python2.7/dist-packages/backup_monkey/cli.py", line 75, in run
monkey.remove_old_snapshots()
File "/usr/local/lib/python2.7/dist-packages/backup_monkey/core.py", line 88, in remove_old_snapshots
snapshot.delete()
File "/usr/local/lib/python2.7/dist-packages/boto/ec2/snapshot.py", line 112, in delete
return self.connection.delete_snapshot(self.id, dry_run=dry_run)
File "/usr/local/lib/python2.7/dist-packages/boto/ec2/connection.py", line 2518, in delete_snapshot
return self.get_status('DeleteSnapshot', params, verb='POST')
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1227, in get_status
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
InvalidSnapshot.InUse
The snapshot snap-9a471c8f is currently in use by ami-4bc0cf215a68a803-2194-4454-b1c1-18005583e2
Hi, if I have understood right the --tag (or --reverse) applies only when I want to add snapshots.
I think it would be useful using --tag when you want to purge old snapshots.
In the case that you take the snapshot with a custom script (because, for example, you want a snapshot in a consistent state, freezing someway the application ) you could then use a command like this
backup-monkey-master$ backup-monkey --region xxx --max-snapshots-per-volume 14 --remove-only --tags MyTag:MyVal
To keep at most 14 snapshots on the snapshots given tag
Regards.
F
PS In any case, the manual says:
--tags TAGS [TAGS ...]
But the following description says --tag :
Only snapshot instances that match passed in tags.
E.g. --tag Name:foo will snapshot all instances with a
tag Name
and value is foo
Hi @pas256 !
while help message says:
--tags TAGS [TAGS ...]
Only snapshot instances that match passed in tags.
E.g. --tag Name:foo will snapshot all instances with a
tag `Name` and value is `foo
the script is running DescribeVolumes
action, expecting EBS volumes to have tags, rather than EC2 instances.
Is that expected behaviour ?
I have Python 2.7 on an OpenSUSE 13.2 machine. I've already installed boto3. Here's what happens when I install backup-monkey:
www2:/srv/www/htdocs/resv # sudo pip install backup-monkey
Downloading/unpacking backup-monkey
Downloading backup_monkey-1.0.0.tar.gz
Running setup.py (path:/tmp/pip_build_root/backup-monkey/setup.py) egg_info for package backup-monkey
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/backup-monkey/setup.py", line 23
print 'Backup Monkey requires Python 2.7.x'
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/backup-monkey/setup.py", line 23
print 'Backup Monkey requires Python 2.7.x'
^
SyntaxError: invalid syntax
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/backup-monkey
Storing debug log for failure in /root/.pip/pip.log
Hi Peter,
I encounter some trackback call while trying to run backup-monkey on version 1.0.0. The error are as follow:
[ec2-user@tappawsl001 backup_monkey-1.0.0]$ backup-monkey
2013-12-10 07:30:41 [INFO] Connecting to region ap-southeast-2
Traceback (most recent call last):
File "/usr/local/bin/backup-monkey", line 9, in
load_entry_point('backup-monkey==1.0.0', 'console_scripts', 'backup-monkey')()
File "/usr/local/lib/python2.7/site-packages/backup_monkey-1.0.0-py2.7.egg/backup_monkey/cli.py", line 70, in run
monkey = BackupMonkey(region, args.max_snapshots_per_volume)
File "/usr/local/lib/python2.7/site-packages/backup_monkey-1.0.0-py2.7.egg/backup_monkey/core.py", line 36, in init
log.error('Could not connect to region %s' % self._ami_region)
AttributeError: 'BackupMonkey' object has no attribute '_ami_region'
I'm quite new with python script so not sure how to troubleshoot it.
Please advice.
Thanks.
Regards,
YT
While tagging the snapshot , It uses a prefix BACKUP_MONKEY..which is kind of confusing while searching from a large number of snapshots. we need to run graffiti_monkey after backup monkey finishes its task..
Hi,
Thanks for backup monkey!
I have an Ubuntu 12.04.2 server that I'm running backup monkey 1.0.0 (via pip) from. I use the command:
backup-monkey --max-snapshots-per-volume 14 --snapshot-only -v >> /var/log/backup_monkey.log
When run manually, this works great (with the caveat that backup monkey provides neither stdout nor stderr, so the log remains empty). Running crontab -l
confirms that this line is in root's crontab:
0 4 * * * backup-monkey --max-snapshots-per-volume 14 --snapshot-only -v >> /var/log/backup_monkey.log
Checking /var/log/syslog
confirms that cron has been running this job. However, EBS snapshots only appear when the command is run manually, never when the cron job runs.
What could be the cause of (or solution to) this?
Thanks,
Andy
Any chance that you'd consider adding an exclude option? I have many resources in our AWS accounts and need to limit what is being snapped automatically by backup monkey. Being able to point it to a txt file containing ebs id's to exclude would be extremely helpful.
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.