backup-remote 0.0.14 → 0.0.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74d32f7f28f6b5a075db7aadd6ba672a999475a0
4
- data.tar.gz: 6d3cae4d8d8780300869419a8e7fe5886be7a77a
3
+ metadata.gz: 12f7725c34fc0dae127bf5c2ad626db08c53e098
4
+ data.tar.gz: 0cb226ebf74cc5518f8f0f1913a858de67764447
5
5
  SHA512:
6
- metadata.gz: d687d3272b1190f836c693197ee34eaed9efbcfb2a600c28dc885ce787caef27d2b43d2129279790366851f3296884b0bdaa53b9dbdb4402f0b76d7d2375d3b1
7
- data.tar.gz: 630e1543c23bffe84de76c4ad57da0698a8076444502c467a0705ee739327964a7da6c68d7167362253714a530df75fb698c36d0a410bd02b8cca2d2a4cd2d02
6
+ metadata.gz: 78353dcc8645517cbac9ea292f6de933af3d726dccb9d13a22501e43c8ffd031d2cda96f1667a703407f36fc15602b7af1ac71c09d2d11b6ffc5e2d908fb0259
7
+ data.tar.gz: 559db904955fe3863553340851f4d1c929f400f989076efa1a0d77e9ed693ab0443e1326f540f7bdf95f0548e8ab588907a0a8ae64d4f9a83a70c442d2a2f673
@@ -12,6 +12,9 @@ module Backup
12
12
 
13
13
 
14
14
  def run_ssh_cmd(hostname, ssh_user, ssh_pass, cmd)
15
+ #cmd = "bash -c 'whoami'"
16
+
17
+ #puts "run ssh cmd: #{hostname}, #{ssh_user}, #{ssh_pass}, #{cmd}"
15
18
  host = SSHKit::Host.new({hostname: hostname, user: ssh_user})
16
19
  host.password = ssh_pass
17
20
 
@@ -20,18 +23,28 @@ module Backup
20
23
 
21
24
  output = ''
22
25
 
26
+ SSHKit::Coordinator.new(host).each in: :sequence do
27
+ output = capture cmd
28
+ end
29
+
30
+
31
+ =begin
23
32
  on all_servers do |srv|
24
- #SSHKit::Coordinator.new(host).each in: :sequence do
25
33
  as(user: ssh_user) do
26
34
  #execute(cmd)
27
35
  output = capture(cmd)
28
36
  end
29
37
  end
38
+ =end
39
+
40
+ puts "output: #{output}"
30
41
 
31
42
  #
32
43
  return { res: 1, output: output }
33
44
 
34
45
  rescue => e
46
+ #puts "ssh error: #{e.message}, #{e.backtrace}"
47
+
35
48
  {
36
49
  res: 0,
37
50
  output: output,
@@ -231,6 +231,9 @@ module Backup
231
231
  raise Error, 'Utility Name Empty' if name.empty?
232
232
 
233
233
  req = Backup::Remote::Command.new
234
+ #req.run_ssh_cmd(server_host, server_ssh_user, server_ssh_password, "whoami")
235
+ #req.run_ssh_cmd(server_host, server_ssh_user, server_ssh_password, "which ruby")
236
+
234
237
  cmd = %Q(which '#{ name }' 2>/dev/null)
235
238
  res = req.run_ssh_cmd(server_host, server_ssh_user, server_ssh_password, cmd)
236
239
  output = res[:output].chomp
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Backup
4
- VERSION = '0.0.14'
4
+ VERSION = '0.0.15'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup-remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Ivak, Michael van Rooijen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: CFPropertyList