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 CHANGED
@@ -1,32 +1,35 @@
1
- # Aebus - Automatic EC2 BackUp Software
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
- ==Sample
7
-
8
- default:
9
- access_key_id: <your_access_key_id>
10
- secret_access_key: <your_secret_access_key>
11
- zone: eu-west1
12
- backups:
13
- daily:
14
- enabled: true
15
- keep: 7
16
- when: 0 3 * * *
17
- weekly:
18
- enabled: true
19
- keep: 5
20
- when: 0 3 * * 1
21
- monthly:
22
- enabled: true
23
- keep: all
24
- when: 0 3 1 * *
25
-
26
-
27
- vol-1234567:
28
-
29
- vol-7654321:
30
- backups:
31
- daily:
32
- enabled: false
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
@@ -5,6 +5,7 @@ require 'commander/import'
5
5
  require 'pathname'
6
6
  require_relative '../lib/aebus'
7
7
 
8
+
8
9
  DEFAULT_CONFIG_NAME = "./aebus.yaml"
9
10
 
10
11
  program :version, Aebus::VERSION
@@ -3,13 +3,12 @@
3
3
  require 'rubygems'
4
4
  require 'AWS'
5
5
  require_relative 'config/config'
6
- require_relative 'aebus_zones'
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
- def zone_to_url(zone)
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
@@ -1,3 +1,3 @@
1
1
  module Aebus
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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.1
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-05 00:00:00.000000000Z
12
+ date: 2011-10-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: commander
16
- requirement: &70097059520900 !ruby/object:Gem::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: *70097059520900
24
+ version_requirements: *70320653233040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: parse-cron
27
- requirement: &70097059520400 !ruby/object:Gem::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: *70097059520400
35
+ version_requirements: *70320653232540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: amazon-ec2
38
- requirement: &70097059519940 !ruby/object:Gem::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: *70097059519940
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:
@@ -1,11 +0,0 @@
1
- module Aebus
2
-
3
- ZONES = {
4
-
5
- "eu-west1" => "eu-west-1.ec2.amazonaws.com",
6
- "us-east-1" => "ec2.us-east-1.amazonaws.com",
7
- "us-west-1" => "ec2.us-west-1.amazonaws.com",
8
- "ap-southeast-1" => "ec2.ap-southeast-1.amazonaws.com"
9
- }
10
-
11
- end