snapsync 0.3.2 → 0.3.3
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/lib/snapsync/cleanup.rb +0 -10
- data/lib/snapsync/cli.rb +8 -14
- data/lib/snapsync/local_sync.rb +1 -1
- data/lib/snapsync/local_target.rb +8 -3
- data/lib/snapsync/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1db39c52daf088025f37bad911ed2cdf61b636d2
|
4
|
+
data.tar.gz: 2d301b73b85d3331020945823873403484230e13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cde7036bd9b9f4a02384d2ddb317905255ba064341b05cd0483ff62a3fbbe4745ddcc0ab599559faa2a51ed82d14fd68d1ac92378a41e0566758d1cfbb331308
|
7
|
+
data.tar.gz: af261e9db68b0905ba7b138956c5e98a29e783fbe5f4db7739091a226ec08342fb156518b4e805fd971cf249be589ed7324373061b6e1f4d3657c70348678737
|
data/lib/snapsync/cleanup.rb
CHANGED
@@ -32,16 +32,6 @@ module Snapsync
|
|
32
32
|
true
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
|
-
if !deleted_snapshots.empty?
|
37
|
-
Snapsync.info "Waiting for subvolumes to be deleted"
|
38
|
-
deleted_snapshots.each do |s|
|
39
|
-
begin
|
40
|
-
Btrfs.popen("subvolume", "sync", s.subvolume_dir.to_s)
|
41
|
-
rescue Btrfs::Error
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
35
|
end
|
46
36
|
end
|
47
37
|
end
|
data/lib/snapsync/cli.rb
CHANGED
@@ -150,29 +150,23 @@ policy for more information
|
|
150
150
|
# Parse the policy option early to avoid breaking later
|
151
151
|
begin
|
152
152
|
policy = normalize_policy(policy)
|
153
|
-
rescue Exception
|
153
|
+
rescue Exception => policy_validation_error
|
154
154
|
# Try to see if the user forgot to add the NAME option or added
|
155
155
|
# the name option but should not have
|
156
156
|
if options[:auto]
|
157
|
-
|
158
|
-
|
159
|
-
rescue InvalidConfiguration
|
160
|
-
false
|
161
|
-
end
|
162
|
-
if valid_policy
|
157
|
+
begin
|
158
|
+
normalize_policy(args[1..-1])
|
163
159
|
raise ArgumentError, "--auto is set but it seems that you did not provide a name"
|
160
|
+
rescue InvalidConfiguration
|
164
161
|
end
|
165
162
|
else
|
166
|
-
|
167
|
-
|
168
|
-
rescue InvalidConfiguration
|
169
|
-
false
|
170
|
-
end
|
171
|
-
if valid_policy
|
163
|
+
begin
|
164
|
+
normalize_policy(args[2..-1])
|
172
165
|
raise ArgumentError, "--auto is not set but it seems that you provided a name"
|
166
|
+
rescue InvalidConfiguration
|
173
167
|
end
|
174
168
|
end
|
175
|
-
raise
|
169
|
+
raise policy_validation_error
|
176
170
|
end
|
177
171
|
|
178
172
|
dirs = Array.new
|
data/lib/snapsync/local_sync.rb
CHANGED
@@ -17,7 +17,7 @@ module Snapsync
|
|
17
17
|
def create_synchronization_point
|
18
18
|
config.create(
|
19
19
|
description: "synchronization snapshot for snapsync",
|
20
|
-
user_data: Hash['important' => 'yes', 'snapsync' => target.uuid])
|
20
|
+
user_data: Hash['important' => 'yes', 'snapsync-description' => target.description, 'snapsync' => target.uuid])
|
21
21
|
end
|
22
22
|
|
23
23
|
def remove_synchronization_points(except_last: true)
|
@@ -34,6 +34,10 @@ module Snapsync
|
|
34
34
|
class InvalidUUIDError < InvalidTargetPath; end
|
35
35
|
class NoUUIDError < InvalidUUIDError; end
|
36
36
|
|
37
|
+
def description
|
38
|
+
"local:#{dir}"
|
39
|
+
end
|
40
|
+
|
37
41
|
def initialize(dir, create_if_needed: true)
|
38
42
|
if !dir.directory?
|
39
43
|
raise ArgumentError, "#{dir} does not exist"
|
@@ -168,18 +172,19 @@ module Snapsync
|
|
168
172
|
return if dry_run
|
169
173
|
|
170
174
|
begin
|
171
|
-
Btrfs.popen("subvolume", "delete", s.subvolume_dir.to_s)
|
175
|
+
Btrfs.popen("subvolume", "delete", '--commit-each', s.subvolume_dir.to_s)
|
172
176
|
rescue Btrfs::Error
|
173
177
|
Snapsync.warn "failed to remove snapshot at #{s.subvolume_dir}, keeping the rest of the snapshot"
|
174
178
|
return
|
175
179
|
end
|
176
180
|
|
177
|
-
s.snapshot_dir.rmtree
|
178
181
|
Snapsync.info "Flushing data to disk"
|
179
182
|
begin
|
180
|
-
Btrfs.popen("subvolume", "sync",
|
183
|
+
Btrfs.popen("subvolume", "sync", self.dir.to_s)
|
181
184
|
rescue Btrfs::Error
|
182
185
|
end
|
186
|
+
|
187
|
+
s.snapshot_dir.rmtree
|
183
188
|
end
|
184
189
|
end
|
185
190
|
end
|
data/lib/snapsync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03
|
11
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -232,9 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
|
-
rubygems_version: 2.
|
235
|
+
rubygems_version: 2.5.1
|
236
236
|
signing_key:
|
237
237
|
specification_version: 4
|
238
238
|
summary: tool to automate backing up snapper snapshots to other medias
|
239
239
|
test_files: []
|
240
|
-
has_rdoc:
|