ec2-rotate-volume-snapshots 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -43,6 +43,10 @@ OptionParser.new do |o|
43
43
  end
44
44
  end
45
45
 
46
+ o.on("--keep-last", "Keep the most recent snapshot, regardless of time-based policy") do |v|
47
+ opts[:keep_last] = true
48
+ end
49
+
46
50
  o.on("--dry-run", "Shows what would happen without doing anything") do |v|
47
51
  opts[:dry_run] = true
48
52
  end
@@ -101,6 +105,10 @@ volume_ids.each do |volume_id|
101
105
  end
102
106
  end
103
107
 
108
+ if keep_reason.nil? && snapshot == snapshots.last && opts[:keep_last]
109
+ keep_reason = 'last snapshot'
110
+ end
111
+
104
112
  if !keep_reason.nil?
105
113
  puts " #{time.strftime '%Y-%m-%d %H:%M:%S'} #{snapshot_id} Keeping for #{keep_reason}"
106
114
  else
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ec2-rotate-volume-snapshots}
8
- s.version = "0.1.1"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Zach Wily"]
12
- s.date = %q{2010-12-30}
12
+ s.date = %q{2011-08-23}
13
13
  s.default_executable = %q{ec2-rotate-volume-snapshots}
14
14
  s.description = %q{Provides a simple way to rotate EC2 snapshots with configurable retention periods.}
15
15
  s.email = %q{zach@zwily.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-rotate-volume-snapshots
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zach Wily
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-30 00:00:00 -07:00
18
+ date: 2011-08-23 00:00:00 -06:00
19
19
  default_executable: ec2-rotate-volume-snapshots
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency