Giter Site home page Giter Site logo

zeus911 / automated-ebs-snapshots Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sebdah/automated-ebs-snapshots

0.0 1.0 0.0 431 KB

Script for managing automated AWS EBS snapshots

Home Page: https://github.com/skymill/automated-ebs-snapshots

License: Apache License 2.0

Makefile 0.42% Python 99.58%

automated-ebs-snapshots's Introduction

automated-ebs-snapshots

Downloads Latest Version License

Automated EBS Snapshots helps you ensure that you have up to date snapshots of your EBS volumes.

All you need to do to get started is documented below.

Installation

pip install automated-ebs-snapshots

Authentication configuration

Automated EBS snapshots can be configured either via command line options or using a configuration file.

Command line options

You can use the following command line options to authenticate to AWS.

AWS configuration options:
  --access-key-id ACCESS_KEY_ID
                        AWS access key
  --secret-access-key SECRET_ACCESS_KEY
                        AWS secret access key
  --region REGION       AWS region

Configuration file

Create a configuration file anywhere on you file system.

[general]
access-key-id: xxxx
secret-access-key: xxxxxxxx
region: eu-west-1

Then use the --config command line option to point at your configuration file.

Watching and unwatching volumes

Start watching a volume

In order to enable automatic snapshots, you need to start watching the volume. The following command will add vol-13245678 to the watchlist with snapshots created daily.

automated-ebs-snapshots --config ~/auto-ebs-snapshots.conf --watch vol-12345678 --interval daily

Add volumes to watch list

To add lots of volumes in one time, we can create a configuration file to define volumes(support volume id or Name tag), interval and retention.

vol-d9d6d6af,weekly,2
volume1,weekly,4
volume2,daily,0

Then run the following command

automated-ebs-snapshots --config ~/auto-ebs-snapshots.conf --watch-file volumes.conf

List watched volumes

List the currently watched volumes and their backup interval

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --list

Stop watching a volume

To stop creating automated backups for a volume, run this:

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --unwatch vol-12345678

Remove volumes from watch list

To remove all volumes in the configuration file, just run:

automated-ebs-snapshots --config ~/auto-ebs-snapshots.conf --unwatch-file volumes.conf

List snapshots for a volume

List all snapshots for the given volume id or volume name

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --snapshots vol-d9d6d6af

Creating snapshots

Now, to start taking snapshots you will need to have Automated EBS Snapshots running. You can either run automated-ebs-snapshots manually (i.e. scheduled in crontab or such) or have it running in daemon mode.

Manual execution

Running automated-ebs-snapshots manually:

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --run

It will check if there are any volumes with no or too old snapshots. New snapshots will be created if needed.

Daemon mode

Start the daemon by running

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --daemon start

Stop the daemon with

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --daemon stop

You can also restart it using

automated-ebs-snapshots --config ~/automated-ebs-snapshots.conf --daemon restart

Release notes

0.4.1

  • Fix for logging incorrect region information when using instance role (#19). Thanks @robaman for the pull request

0.4.0

  • Added support for reading volumes from file (#13). Thanks @yumminhuang for the pull request
  • Now supports managing volumes by tag Name in addition to volume-id (#13). Thanks @yumminhuang for the pull request

0.3.2

  • Bumped requirement to boto >= 2.29.0 (#7)

0.3.1

  • Fixed IAM Instance Profile authentication for boto >= 2.29.0 (#6)

0.3.0

  • Print volume Name tag in --list (#3)
  • Support authentication using instance profiles (#5)
  • Only write logs to file if --log-file is specified (#2)

Author

This project is maintained by Sebastian Dahlgren and it is supported by Skymill Solutions.

License

APACHE LICENSE 2.0 Copyright 2014 Skymill Solutions

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

automated-ebs-snapshots's People

Contributors

danieljensen avatar robaman avatar sebdah avatar yumminhuang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.