snapsync 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 641ca51fa87cdb9f32a4395c070f8ebe2513d04e
4
- data.tar.gz: 4ba5fe6fa7dedf496e4edb6e4b09345a4c52cab5
3
+ metadata.gz: 38bab1614373f2385245f2e093bc560c3c7e1dd0
4
+ data.tar.gz: 3343524d89264155f5ae303e85aa9a92a47fc594
5
5
  SHA512:
6
- metadata.gz: 863e89167e66a226dcc542bd9a4b11d962387244bd57fbc07667fb5223aa4ea0b4cbdb777672ef810d6a7b269fb291e891ffe3ea2e06bc425a901204a4351c64
7
- data.tar.gz: b867d49ffb21283f8a80a05c590f7dc1f757cedd2c6a4f52a0235e0c7033ff30b00d57efaa7ac7d35aaabd79292718fc250bcc80dec27b4457b17d4827a4771a
6
+ metadata.gz: c13a2ac4ed65de64035f3a4e212aed9ac4ef6569c9503893f892bdcc59385f39c972319b7372d56d0c9fd89e44cb3b53a3aaa98a0b85b26b1f96ce333ecb6fde
7
+ data.tar.gz: 85751adfae9447bfa4b33dd8413097eeb966e050f7f2ab59794417113a80d349e6045d7a1bda5386d7811b8f76502e32d07693c577afa5dce41229c40cf69af4
data/install.sh CHANGED
@@ -15,9 +15,9 @@ fi
15
15
 
16
16
  if test -d /lib/systemd/system; then
17
17
  snapsync_gem=`bundler show snapsync`
18
- cp $snapsync_gem/snapsync.service /lib/systemd/system
19
- ( systemctl enable snapsync.service
20
- systemctl start snapsync.service )
18
+ sudo cp $snapsync_gem/snapsync.service /lib/systemd/system
19
+ ( sudo systemctl enable snapsync.service
20
+ sudo systemctl start snapsync.service )
21
21
  fi
22
22
 
23
23
  rm -rf $target
@@ -135,13 +135,13 @@ module Snapsync
135
135
  Snapsync.info "Removing snapshot #{s.num} #{s.date.to_time} at #{s.subvolume_dir}"
136
136
  return if dry_run
137
137
 
138
- IO.popen(["sudo", "btrfs", "subvolume", "delete", s.subvolume_dir.to_s, err: '/dev/null']) do |io|
138
+ IO.popen(["btrfs", "subvolume", "delete", s.subvolume_dir.to_s, err: '/dev/null']) do |io|
139
139
  io.read
140
140
  end
141
141
  if $?.success?
142
142
  s.snapshot_dir.rmtree
143
143
  Snapsync.info "Flushing data to disk"
144
- IO.popen(["sudo", "btrfs", "filesystem", "sync", s.snapshot_dir.to_s, err: '/dev/null']).read
144
+ IO.popen(["btrfs", "filesystem", "sync", s.snapshot_dir.to_s, err: '/dev/null']).read
145
145
  else
146
146
  Snapsync.warn "failed to remove snapshot at #{s.subvolume_dir}, keeping the rest of the snapshot"
147
147
  end
@@ -78,7 +78,7 @@ module Snapsync
78
78
  # This is an estimate of the size required to send this snapshot using
79
79
  # the given snapshot as parent
80
80
  def size_diff_from(snapshot)
81
- info = `sudo btrfs subvolume show '#{snapshot.subvolume_dir}'`
81
+ info = IO.popen(['btrfs', 'subvolume', 'show', snapshot.subvolume_dir.to_s, err: '/dev/null']).read
82
82
  info =~ /Generation[^:]*:\s+(\d+)/
83
83
  size_diff_from_gen(Integer($1))
84
84
  end
@@ -89,7 +89,7 @@ module Snapsync
89
89
  end
90
90
 
91
91
  def size_diff_from_gen(gen)
92
- new = `sudo btrfs subvolume find-new '#{subvolume_dir}' #{gen}`
92
+ new = IO.popen(['btrfs', 'subvolume', 'find-new', subvolume_dir.to_s, gen.to_s, err: '/dev/null']).read
93
93
  new.split("\n").inject(0) do |size, line|
94
94
  if line.strip =~ /len (\d+)/
95
95
  size + Integer($1)
@@ -1,3 +1,3 @@
1
1
  module Snapsync
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
@@ -14,148 +14,148 @@ dependencies:
14
14
  name: logging
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
- - - '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '2.0'
30
- - - '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: concurrent-ruby
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: 0.9.0
40
- - - '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0.9'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.9.0
50
- - - '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0.9'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: ruby-dbus
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ~>
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 0.11.0
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0.11'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 0.11.0
70
- - - '>='
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0.11'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: thor
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ~>
77
+ - - "~>"
78
78
  - !ruby/object:Gem::Version
79
79
  version: 0.19.0
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.19.1
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.19.0
90
- - - '>='
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: 0.19.1
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: bundler
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ~>
97
+ - - "~>"
98
98
  - !ruby/object:Gem::Version
99
99
  version: '1.10'
100
100
  type: :development
101
101
  prerelease: false
102
102
  version_requirements: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ~>
104
+ - - "~>"
105
105
  - !ruby/object:Gem::Version
106
106
  version: '1.10'
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: rake
109
109
  requirement: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ~>
111
+ - - "~>"
112
112
  - !ruby/object:Gem::Version
113
113
  version: '10.0'
114
114
  type: :development
115
115
  prerelease: false
116
116
  version_requirements: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ~>
118
+ - - "~>"
119
119
  - !ruby/object:Gem::Version
120
120
  version: '10.0'
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: minitest
123
123
  requirement: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - ~>
125
+ - - "~>"
126
126
  - !ruby/object:Gem::Version
127
127
  version: '5.0'
128
- - - '>='
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '5.7'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ~>
135
+ - - "~>"
136
136
  - !ruby/object:Gem::Version
137
137
  version: '5.0'
138
- - - '>='
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '5.7'
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: flexmock
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ~>
145
+ - - "~>"
146
146
  - !ruby/object:Gem::Version
147
147
  version: '1.3'
148
- - - '>='
148
+ - - ">="
149
149
  - !ruby/object:Gem::Version
150
150
  version: 1.3.3
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ~>
155
+ - - "~>"
156
156
  - !ruby/object:Gem::Version
157
157
  version: '1.3'
158
- - - '>='
158
+ - - ">="
159
159
  - !ruby/object:Gem::Version
160
160
  version: 1.3.3
161
161
  description:
@@ -166,8 +166,8 @@ executables:
166
166
  extensions: []
167
167
  extra_rdoc_files: []
168
168
  files:
169
- - .gitignore
170
- - .travis.yml
169
+ - ".gitignore"
170
+ - ".travis.yml"
171
171
  - Gemfile
172
172
  - Gemfile.install
173
173
  - LICENSE.txt
@@ -203,17 +203,17 @@ require_paths:
203
203
  - lib
204
204
  required_ruby_version: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - '>='
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  requirements:
211
- - - '>='
211
+ - - ">="
212
212
  - !ruby/object:Gem::Version
213
213
  version: '0'
214
214
  requirements: []
215
215
  rubyforge_project:
216
- rubygems_version: 2.0.14
216
+ rubygems_version: 2.2.2
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: tool to automate backing up snapper snapshots to other medias