elastic-backup-2s3 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/elastic-backup-2s3.gemspec +2 -2
- data/lib/elastic-backup-2s3/cli/list.rb +3 -2
- data/lib/elastic-backup-2s3/snapshot.rb +20 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a7912acef5681f663794fdb260b5435edfbc883
|
4
|
+
data.tar.gz: fb62fb7e9c85edddd704349dc90ad7d3df0d7c34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b794448194231cf4cf42ee5f0e67895caffc99e20069306f9e56ffa0a1ecff25c5318a3e99c90046ff185fffdb4b9278eabb0403390e4748dd3eb6c68ed3bc3f
|
7
|
+
data.tar.gz: b1e26801a774e95a4674c820ae3a39d0aa6c3947d96a95d1175361f7f73588919cb2a93b2c7976b0588a2f71a9841367d87fb92de634a014b5358979f07286be
|
data/.semver
CHANGED
data/elastic-backup-2s3.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: elastic-backup-2s3 0.0.
|
5
|
+
# stub: elastic-backup-2s3 0.0.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "elastic-backup-2s3"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -54,11 +54,12 @@ module ElasticBackup
|
|
54
54
|
snapshot: '_all')
|
55
55
|
unless options[:detailed]
|
56
56
|
table = Text::Table.new
|
57
|
-
table.head = ['Snapshot', 'State', 'Started']
|
57
|
+
table.head = ['Snapshot', 'State', 'Started', 'Duration']
|
58
58
|
table.rows = statuses['snapshots'].map { |s|
|
59
59
|
[s["snapshot"],
|
60
60
|
s["state"],
|
61
|
-
s["start_time"]
|
61
|
+
s["start_time"],
|
62
|
+
s['end_time_in_millis'].nil? ? 'N/A' : Snapshot.pretty_time(s['end_time_in_millis'] - s['start_time_in_millis']) ]
|
62
63
|
}
|
63
64
|
puts table
|
64
65
|
else
|
@@ -15,6 +15,26 @@ module ElasticBackup
|
|
15
15
|
@opt ||= options
|
16
16
|
end
|
17
17
|
|
18
|
+
# return a pretty time format from milliseconds
|
19
|
+
def pretty_time(milliseconds)
|
20
|
+
secs = milliseconds / 1000
|
21
|
+
mins = secs / 60
|
22
|
+
hours = mins / 60
|
23
|
+
days = hours / 24
|
24
|
+
|
25
|
+
if days > 0
|
26
|
+
"#{days} days #{hours % 24} hours"
|
27
|
+
elsif hours > 0
|
28
|
+
"#{hours} hours #{mins % 60} mimutes"
|
29
|
+
elsif mins > 0
|
30
|
+
"#{mins} minutes #{secs % 60} seconds"
|
31
|
+
elsif secs > 0
|
32
|
+
"#{secs} seconds"
|
33
|
+
else
|
34
|
+
"#{milliseconds} milliseconds"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
18
38
|
# Take the s3 url and break it down to
|
19
39
|
# its components [BUCKET, PATH, SNAPSHOT]
|
20
40
|
def s3url_splice(surl)
|