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 +4 -4
- data/lib/restic/service/cli.rb +16 -0
- data/lib/restic/service/targets/base.rb +1 -1
- data/lib/restic/service/targets/restic.rb +0 -1
- data/lib/restic/service/targets/restic_b2.rb +5 -0
- data/lib/restic/service/targets/restic_sftp.rb +6 -0
- data/lib/restic/service/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ff237d54773db3d170586b56b3f3586301f4ae4872f76bf22809fc5c5e2848
|
4
|
+
data.tar.gz: 73c9dc2c106bcdbe7224575cd88b87d33ae7d233216ecf83dd3b32d0ee73144c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253b73a28cf68083b40f7fbb8f5ed256d32e44e6285230b894d195fd950bf30ff3e637846004c204648468b9ba013f7d8e352182c7ee42c96552993a918f780f
|
7
|
+
data.tar.gz: 16a171d3e6d3631da2de13b823a2288ed2cc07e2e75eb412b10d2c0084f4fcda5a2a63bd9ab2c1d3acb98e11d4cde883762c0918907a6a3a04fb3dfc7c30b7c5
|
data/lib/restic/service/cli.rb
CHANGED
@@ -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
|
@@ -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
|
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
|
+
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:
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|