sr-scripts 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/sr-backup-mysql +11 -0
- data/lib/sr-scripts/version.rb +1 -1
- metadata +3 -3
data/bin/sr-backup-mysql
CHANGED
@@ -32,3 +32,14 @@ if pending
|
|
32
32
|
end
|
33
33
|
#p "./ec2-consistent-snapshot-rb -f conf.yml #{volumes.join(' ')}"
|
34
34
|
`sr-ec2-consistent-snapshot -f /etc/sr-ec2-consistent-snapshot.yml #{volumes.join(' ')}`
|
35
|
+
|
36
|
+
# Purge the extra backups
|
37
|
+
volumes.each do |volume_id|
|
38
|
+
snapshots = connection.snapshots.all({"volume-id" => volume_id, "status" => "completed"}).sort { |a,b| b.created_at <=> a.created_at }
|
39
|
+
# Remove the first X number of snapshots to keep them
|
40
|
+
5.times { snapshots.shift }
|
41
|
+
|
42
|
+
snapshots.each do |s|
|
43
|
+
connection.delete_snapshot s.id
|
44
|
+
end
|
45
|
+
end
|
data/lib/sr-scripts/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sr-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Davy Campano
|