do_snapshot 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -13
- data/lib/do_snapshot/cli.rb +10 -10
- data/lib/do_snapshot/command.rb +1 -2
- data/lib/do_snapshot/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +25 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1832957a7416c15f2755720be734b7153dc19856
|
4
|
+
data.tar.gz: 4cd6ea976f4bbbe26051e10b538e4e213f7cd87c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c988328d3c25992b45336a37e34ff535f5db6e4545ae9946c77b24dd9866517734bf27653e4e170451463ae94580053c88a968f2f9acda141b00ccbb66a0b12
|
7
|
+
data.tar.gz: 10532b1d32445a9cd7c28d84119524cd6a8399103295639dcabfe308dd6eddb2aa2c2a1fb4c95e2eecd36a7d026574d33d4693e745a5a00b93d89662272fc471
|
data/README.md
CHANGED
@@ -45,13 +45,17 @@ Install it yourself as:
|
|
45
45
|
|
46
46
|
$ gem install do_snapshot
|
47
47
|
|
48
|
+
Or System Wide Install (OSX, *nix):
|
49
|
+
|
50
|
+
$ sudo gem install do_snapshot
|
51
|
+
|
48
52
|
For **OSX** users ([Homebrew Tap](http://github.com/merqlove/homebrew-do-snapshot)):
|
49
53
|
|
50
54
|
$ brew tap merqlove/do-snapshot && brew install do_snapshot
|
51
55
|
|
52
56
|
$ do_snapshot -V
|
53
57
|
|
54
|
-
Standalone pack for **Unix/Linux** users: [Download](https://assets.merqlove.ru.s3.amazonaws.com/do_snapshot/
|
58
|
+
Standalone pack for **Unix/Linux** users: [Download](https://assets.merqlove.ru.s3.amazonaws.com/do_snapshot/do_snapshot.tgz)
|
55
59
|
|
56
60
|
$ wget https://assets.merqlove.ru.s3.amazonaws.com/do_snapshot/do_snapshot.tgz # if not done.
|
57
61
|
|
@@ -60,17 +64,17 @@ Standalone pack for **Unix/Linux** users: [Download](https://assets.merqlove.ru.
|
|
60
64
|
$ tar -xzf do_snapshot.tgz /usr/local/ && ln -s /usr/local/do_snapshot/bin/do_snapshot /usr/local/bin/do_snapshot
|
61
65
|
$ do_snapshot help
|
62
66
|
|
63
|
-
|
67
|
+
Standalone Zip pack for others: [Download](https://assets.merqlove.ru.s3.amazonaws.com/do_snapshot/do_snapshot.zip)
|
68
|
+
|
69
|
+
## Usage
|
64
70
|
|
65
|
-
|
71
|
+
Mainly it's pretty simple:
|
66
72
|
|
67
|
-
|
73
|
+
$ do_snapshot --only 123456 -k 5 -c -v
|
68
74
|
|
69
|
-
|
70
|
-
|
71
|
-
## Usage
|
75
|
+
### Setup
|
72
76
|
|
73
|
-
|
77
|
+
How to set DigitalOcean API keys:
|
74
78
|
|
75
79
|
$ export DIGITAL_OCEAN_CLIENT_ID="SOMEID"
|
76
80
|
$ export DIGITAL_OCEAN_API_KEY="SOMEKEY"
|
@@ -79,17 +83,17 @@ If you want to set keys without environment, than set it via options when you ru
|
|
79
83
|
|
80
84
|
$ do_snapshot --digital-ocean-client-id YOURLONGAPICLIENTID --digital-ocean-api-key YOURLONGAPIKEY
|
81
85
|
|
82
|
-
### How-To
|
86
|
+
### How-To (Here is also [Longren Tutorial](https://longren.io/automate-making-snapshots-of-your-digitalocean-droplets/))
|
83
87
|
|
84
88
|
Here we `keeping` only 5 **latest** snapshots and cleanup older after new one is created. If creation of snapshots failed no one will be deleted. By default we keeping `10` droplets.
|
85
89
|
|
86
90
|
$ do_snapshot --keep 5 -c
|
87
91
|
|
88
|
-
Keep latest 3 from selected
|
92
|
+
Keep latest 3 from selected droplet:
|
89
93
|
|
90
|
-
$ do_snapshot --only 123456
|
94
|
+
$ do_snapshot --only 123456 --keep 3
|
91
95
|
|
92
|
-
Working with all except
|
96
|
+
Working with all except droplets:
|
93
97
|
|
94
98
|
$ do_snapshot --exclude 123456 123457
|
95
99
|
|
@@ -106,7 +110,7 @@ For working mailer you need to set e-mail settings via run options.
|
|
106
110
|
|
107
111
|
### Cron example
|
108
112
|
|
109
|
-
0 4 * * 7 /.../bin/do_snapshot -k 5 -m to:TO from:FROM -t address:HOST user_name:LOGIN password:PASSWORD port:2525 -q -c
|
113
|
+
0 4 * * 7 . /.../.digitalocean_keys && /.../bin/do_snapshot -k 5 -m to:TO from:FROM -t address:HOST user_name:LOGIN password:PASSWORD port:2525 -q -c
|
110
114
|
|
111
115
|
### Real world example
|
112
116
|
|
@@ -172,3 +176,11 @@ For working mailer you need to set e-mail settings via run options.
|
|
172
176
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
173
177
|
4. Push to the branch (`git push origin my-new-feature`)
|
174
178
|
5. Create a new Pull Request
|
179
|
+
|
180
|
+
### Testing
|
181
|
+
|
182
|
+
$ rake spec
|
183
|
+
|
184
|
+
Copyright (c) 2014 Alexander Merkulov
|
185
|
+
|
186
|
+
MIT License
|
data/lib/do_snapshot/cli.rb
CHANGED
@@ -36,21 +36,15 @@ module DoSnapshot
|
|
36
36
|
|
37
37
|
You can optionally specify parameters to select or exclude some droplets.
|
38
38
|
|
39
|
-
### Advanced options example for MAIL feature:
|
40
|
-
|
41
|
-
--mail to:mail@somehost.com from:from@host.com --smtp address:smtp.gmail.com port:25 user_name:someuser password:somepassword
|
42
|
-
|
43
|
-
For more details look here: https://github.com/benprew/pony
|
44
|
-
|
45
39
|
### Examples
|
46
40
|
|
47
|
-
Keep latest 5 and cleanup older if maximum is reached:
|
41
|
+
Keep latest 5 and cleanup older if maximum is reached, verbose:
|
48
42
|
|
49
|
-
$ do_snapshot
|
43
|
+
$ do_snapshot -k 5 -c -v
|
50
44
|
|
51
|
-
Keep latest 3 from selected
|
45
|
+
Keep latest 3 from selected droplet:
|
52
46
|
|
53
|
-
$ do_snapshot --only 123456
|
47
|
+
$ do_snapshot --only 123456 --keep 3
|
54
48
|
|
55
49
|
Working with all except selected droplets:
|
56
50
|
|
@@ -64,6 +58,12 @@ module DoSnapshot
|
|
64
58
|
|
65
59
|
0 4 * * 7 /.../bin/do_snapshot -k 5 -m to:TO from:FROM -t address:HOST user_name:LOGIN password:PASSWORD port:2525 -q -c
|
66
60
|
|
61
|
+
### Advanced options example for MAIL feature:
|
62
|
+
|
63
|
+
--mail to:mail@somehost.com from:from@host.com --smtp address:smtp.gmail.com port:25 user_name:someuser password:somepassword
|
64
|
+
|
65
|
+
For more details look here: https://github.com/benprew/pony
|
66
|
+
|
67
67
|
VERSION: #{DoSnapshot::VERSION}
|
68
68
|
LONGDESC
|
69
69
|
method_option :only,
|
data/lib/do_snapshot/command.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
# require 'thread'
|
3
2
|
require 'do_snapshot/api'
|
4
3
|
|
5
4
|
module DoSnapshot
|
@@ -82,7 +81,7 @@ module DoSnapshot
|
|
82
81
|
# Join threads
|
83
82
|
#
|
84
83
|
def thread_chain
|
85
|
-
threads.each
|
84
|
+
threads.each(&:join)
|
86
85
|
end
|
87
86
|
|
88
87
|
# Run threads
|
data/lib/do_snapshot/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: do_snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Merkulov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: digitalocean
|
@@ -94,48 +94,62 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.24'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.1'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.1'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rspec-core
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3.
|
117
|
+
version: '3.1'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '3.
|
124
|
+
version: '3.1'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rspec-expectations
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - ">="
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '3.
|
131
|
+
version: '3.1'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '3.
|
138
|
+
version: '3.1'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rspec-mocks
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
143
|
- - ">="
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '3.
|
145
|
+
version: '3.1'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '3.
|
152
|
+
version: '3.1'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: webmock
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +193,7 @@ dependencies:
|
|
179
193
|
- !ruby/object:Gem::Version
|
180
194
|
version: '0'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
196
|
+
name: s3
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
199
|
- - ">="
|
@@ -252,8 +266,8 @@ rubyforge_project:
|
|
252
266
|
rubygems_version: 2.2.2
|
253
267
|
signing_key:
|
254
268
|
specification_version: 4
|
255
|
-
summary:
|
256
|
-
|
269
|
+
summary: A command-line snapshot maker for your DigitalOcean droplets. Fully Automated.
|
270
|
+
Multi-threaded.
|
257
271
|
test_files:
|
258
272
|
- spec/.keep
|
259
273
|
- spec/do_snapshot/api_spec.rb
|