aebus 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +31 -28
- data/bin/aebus +1 -0
- data/lib/aebus.rb +6 -9
- data/lib/aebus/version.rb +1 -1
- data/lib/ec2/zones.rb +19 -0
- metadata +9 -9
- data/lib/aebus_zones.rb +0 -11
data/README
CHANGED
@@ -1,32 +1,35 @@
|
|
1
|
-
|
1
|
+
= Aebus - Automatic EC2 BackUp Software
|
2
2
|
|
3
3
|
A small gem that allows you to easily automate EC2 backups, included purging of old backups and checking the backup status
|
4
4
|
|
5
|
+
=== Configuration
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
vol-
|
30
|
-
|
31
|
-
|
32
|
-
|
7
|
+
|
8
|
+
|
9
|
+
==== Sample
|
10
|
+
|
11
|
+
default:
|
12
|
+
access_key_id: <your_access_key_id>
|
13
|
+
secret_access_key: <your_secret_access_key>
|
14
|
+
zone: eu-west1
|
15
|
+
backups:
|
16
|
+
daily:
|
17
|
+
enabled: true
|
18
|
+
keep: 7
|
19
|
+
when: 0 3 * * *
|
20
|
+
weekly:
|
21
|
+
enabled: true
|
22
|
+
keep: 5
|
23
|
+
when: 0 3 * * 1
|
24
|
+
monthly:
|
25
|
+
enabled: true
|
26
|
+
keep: all
|
27
|
+
when: 0 3 1 * *
|
28
|
+
|
29
|
+
|
30
|
+
vol-1234567:
|
31
|
+
|
32
|
+
vol-7654321:
|
33
|
+
backups:
|
34
|
+
daily:
|
35
|
+
enabled: false
|
data/bin/aebus
CHANGED
data/lib/aebus.rb
CHANGED
@@ -3,13 +3,12 @@
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'AWS'
|
5
5
|
require_relative 'config/config'
|
6
|
-
require_relative '
|
6
|
+
require_relative 'aebus/version'
|
7
|
+
require_relative 'ec2/zones'
|
7
8
|
require_relative 'ec2/snapshot'
|
8
9
|
|
9
10
|
module Aebus
|
10
11
|
|
11
|
-
VERSION = '0.0.1'
|
12
|
-
|
13
12
|
class Aebus
|
14
13
|
|
15
14
|
AWS_NAME_TAG = "Name"
|
@@ -20,7 +19,7 @@ module Aebus
|
|
20
19
|
config = Config::Config.new(File.join(File.dirname("."), options.config), current_time_utc)
|
21
20
|
@ec2 = AWS::EC2::Base.new(:access_key_id => config.defaults["access_key_id"],
|
22
21
|
:secret_access_key => config.defaults["secret_access_key"],
|
23
|
-
:server => zone_to_url(config.defaults["zone"]))
|
22
|
+
:server => EC2::zone_to_url(config.defaults["zone"]))
|
24
23
|
|
25
24
|
target_volumes = calculate_target_volumes(config, args)
|
26
25
|
snap_map = get_snapshots_map
|
@@ -48,7 +47,7 @@ module Aebus
|
|
48
47
|
config = Config::Config.new(File.join(File.dirname("."), options.config), current_time_utc)
|
49
48
|
@ec2 = AWS::EC2::Base.new(:access_key_id => config.defaults["access_key_id"],
|
50
49
|
:secret_access_key => config.defaults["secret_access_key"],
|
51
|
-
:server => zone_to_url(config.defaults["zone"]))
|
50
|
+
:server => EC2::zone_to_url(config.defaults["zone"]))
|
52
51
|
|
53
52
|
target_volumes = calculate_target_volumes(config, args)
|
54
53
|
if (options.manual) then
|
@@ -108,9 +107,7 @@ module Aebus
|
|
108
107
|
end
|
109
108
|
|
110
109
|
|
111
|
-
|
112
|
-
ZONES[zone]
|
113
|
-
end
|
110
|
+
|
114
111
|
|
115
112
|
def backup_volume(volume_id, current_time_utc, tags)
|
116
113
|
begin
|
@@ -194,7 +191,7 @@ module Aebus
|
|
194
191
|
def purge_snapshot(snapshot_id)
|
195
192
|
begin
|
196
193
|
response = @ec2.delete_snapshot(:snapshot_id => snapshot_id)
|
197
|
-
if (response[return]) then
|
194
|
+
if (response["return"]) then
|
198
195
|
puts("[INFO] Purged snapshot #{snapshot_id}")
|
199
196
|
end
|
200
197
|
rescue AWS::Error => e
|
data/lib/aebus/version.rb
CHANGED
data/lib/ec2/zones.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Aebus
|
2
|
+
|
3
|
+
module EC2
|
4
|
+
|
5
|
+
ZONES = {
|
6
|
+
|
7
|
+
"eu-west1" => "eu-west-1.ec2.amazonaws.com",
|
8
|
+
"us-east-1" => "ec2.us-east-1.amazonaws.com",
|
9
|
+
"us-west-1" => "ec2.us-west-1.amazonaws.com",
|
10
|
+
"ap-southeast-1" => "ec2.ap-southeast-1.amazonaws.com"
|
11
|
+
}
|
12
|
+
|
13
|
+
def self.zone_to_url(zone)
|
14
|
+
ZONES[zone]
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aebus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-06 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: commander
|
16
|
-
requirement: &
|
16
|
+
requirement: &70320653233040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 4.0.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70320653233040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: parse-cron
|
27
|
-
requirement: &
|
27
|
+
requirement: &70320653232540 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.1.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70320653232540
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: amazon-ec2
|
38
|
-
requirement: &
|
38
|
+
requirement: &70320653232080 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 0.9.17
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70320653232080
|
47
47
|
description: A tool to automate snapshot management in EC2
|
48
48
|
email:
|
49
49
|
- nessche@gmail.com
|
@@ -60,10 +60,10 @@ files:
|
|
60
60
|
- bin/aebus
|
61
61
|
- lib/aebus.rb
|
62
62
|
- lib/aebus/version.rb
|
63
|
-
- lib/aebus_zones.rb
|
64
63
|
- lib/config/config.rb
|
65
64
|
- lib/config/volume.rb
|
66
65
|
- lib/ec2/snapshot.rb
|
66
|
+
- lib/ec2/zones.rb
|
67
67
|
homepage: https://github.com/nessche/Aebus
|
68
68
|
licenses: []
|
69
69
|
post_install_message:
|
data/lib/aebus_zones.rb
DELETED