restic-service 0.4.3 → 0.5.0

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
  SHA256:
3
- metadata.gz: 7987fe454004f669397372913be02a73ad407a118ba7d6fcfde8df702e74f9d9
4
- data.tar.gz: e4443b8167b046aa0b43e195e3dfb9b2dfb7a8b89e46eb448bdd0ddae1b95ba3
3
+ metadata.gz: c8ff237d54773db3d170586b56b3f3586301f4ae4872f76bf22809fc5c5e2848
4
+ data.tar.gz: 73c9dc2c106bcdbe7224575cd88b87d33ae7d233216ecf83dd3b32d0ee73144c
5
5
  SHA512:
6
- metadata.gz: f7d95150bd1d889a289008c41464540f49f465ecd5c5b765bfbabd365c7b213ed5975c3af01065be7784710b6be6eadc45a68d41089ea0418ad16fe81d99f84a
7
- data.tar.gz: 6a9482ffc2d6b7e3c656f1365db623116a242db0b8b28becf54498ded4c2a619009ecdb21c5368ab556ca906d0bf39353df5fe6f7154810f9d2c8a05870c9141
6
+ metadata.gz: 253b73a28cf68083b40f7fbb8f5ed256d32e44e6285230b894d195fd950bf30ff3e637846004c204648468b9ba013f7d8e352182c7ee42c96552993a918f780f
7
+ data.tar.gz: 16a171d3e6d3631da2de13b823a2288ed2cc07e2e75eb412b10d2c0084f4fcda5a2a63bd9ab2c1d3acb98e11d4cde883762c0918907a6a3a04fb3dfc7c30b7c5
@@ -68,6 +68,15 @@ module Restic
68
68
  end
69
69
  end
70
70
 
71
+ def run_restic(conf, targets, *args)
72
+ each_selected_and_available_target(conf, *targets) do |target|
73
+ if target.respond_to?(:run_restic)
74
+ puts "Running command for #{target.name}"
75
+ target.restic(*args)
76
+ end
77
+ end
78
+ end
79
+
71
80
  def auto_update_tool(conf, updater, name, version)
72
81
  begin
73
82
  path = conf.tool_path(name, only_if_present: false)
@@ -164,6 +173,13 @@ module Restic
164
173
  sleep conf.period
165
174
  end
166
175
  end
176
+
177
+ desc 'restic', 'run a raw restic command on a given target'
178
+ option 'targets', desc: 'restrict to these targets', type: :array, default: []
179
+ def restic(*args)
180
+ conf = load_conf
181
+ run_restic(conf, options[:targets], *args)
182
+ end
167
183
  end
168
184
  end
169
185
  end
@@ -40,7 +40,7 @@ module Restic
40
40
  result = []
41
41
  if @io_class
42
42
  result << 'ionice' << '-c' << @io_class.to_s
43
- if @io_priority
43
+ if @io_priority && @io_class != 3
44
44
  result << '-n' << @io_priority.to_s
45
45
  end
46
46
  end
@@ -114,7 +114,6 @@ module Restic
114
114
  end
115
115
  if @forget.prune?
116
116
  extra_args << "--prune"
117
- puts "PRUNE"
118
117
  end
119
118
  run_restic(*args, *extra_args)
120
119
  end
@@ -21,6 +21,11 @@ module Restic
21
21
  run_forget(Hash['B2_ACCOUNT_ID' => @id, 'B2_ACCOUNT_KEY' => @key],
22
22
  '-r', "b2:#{@bucket}:#{@path}", 'forget')
23
23
  end
24
+
25
+ def restic(*args)
26
+ run_restic(Hash['B2_ACCOUNT_ID' => @id, 'B2_ACCOUNT_KEY' => @key],
27
+ '-r', "b2:#{@bucket}:#{@path}", *args)
28
+ end
24
29
  end
25
30
  end
26
31
  end
@@ -42,6 +42,12 @@ module Restic
42
42
  run_forget('-r', "sftp:#{ssh_config_name}:#{@path}", 'forget')
43
43
  end
44
44
  end
45
+
46
+ def restic(*args)
47
+ with_ssh_config do |ssh_config_name|
48
+ run_restic('-r', "sftp:#{ssh_config_name}:#{@path}", *args)
49
+ end
50
+ end
45
51
  end
46
52
  end
47
53
  end
@@ -1,5 +1,5 @@
1
1
  module Restic
2
2
  module Service
3
- VERSION = "0.4.3"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restic-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor