backup-remote 0.0.15 → 0.0.16

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: 12f7725c34fc0dae127bf5c2ad626db08c53e098
4
- data.tar.gz: 0cb226ebf74cc5518f8f0f1913a858de67764447
3
+ metadata.gz: 6162739675f6b4821155caf28c60e1fec69f9cec
4
+ data.tar.gz: 7025b3537b82c39ee76745a901a17cb20ae4efb7
5
5
  SHA512:
6
- metadata.gz: 78353dcc8645517cbac9ea292f6de933af3d726dccb9d13a22501e43c8ffd031d2cda96f1667a703407f36fc15602b7af1ac71c09d2d11b6ffc5e2d908fb0259
7
- data.tar.gz: 559db904955fe3863553340851f4d1c929f400f989076efa1a0d77e9ed693ab0443e1326f540f7bdf95f0548e8ab588907a0a8ae64d4f9a83a70c442d2a2f673
6
+ metadata.gz: 1e0f6c25f973fecf29c4bc5809a3cab8512bce0dcc51f37f5f0e3a673b17e3dba4478532e1e36f224f8008737e624f74741393ea47823ef7fd550199556fd74e
7
+ data.tar.gz: bed9ee7905040dfdc5fc0f3cbf98a78225f64ac8824033a2d1935d1796f15e02f870f5a69c334becf42ca14a45e58dd9f85604819baa9ffd0dd51b045254823a
@@ -127,21 +127,31 @@ module Backup
127
127
  f_temp = "/tmp/#{SecureRandom.uuid}"
128
128
 
129
129
  # sshkit
130
- on host do |host|
131
- as(user: ssh_user) do
130
+ SSHKit::Coordinator.new(host).each in: :sequence do
131
+ # upload to temp file
132
+ upload! source_file, f_temp
132
133
 
133
- end
134
+ # upload to dest
135
+ execute("cp #{f_temp} #{dest_file}", interaction_handler: handler)
134
136
 
137
+ end
138
+
139
+ =begin
140
+ on host do |host|
135
141
  # NOT WORK with sudo
136
142
  #upload! source_file, dest_file
137
143
 
138
- # upload to temp file
139
- upload! source_file, f_temp
140
144
 
141
- # upload to dest
142
- execute("cp #{f_temp} #{dest_file}", interaction_handler: handler)
145
+ as(user: ssh_user) do
146
+ # upload to temp file
147
+ upload! source_file, f_temp
148
+
149
+ # upload to dest
150
+ execute("cp #{f_temp} #{dest_file}", interaction_handler: handler)
143
151
 
152
+ end
144
153
  end
154
+ =end
145
155
 
146
156
  #
147
157
  return {res: 1, output: ""}
@@ -105,7 +105,7 @@ module Backup
105
105
  res_upload = remote.ssh_upload_file(server_host, server_ssh_user, server_ssh_password, files_from, files_from)
106
106
 
107
107
  if res_upload[:res]==0
108
- raise 'Cannot upload file from server - #{files_from}'
108
+ raise "Cannot upload file to server - #{files_from}"
109
109
  end
110
110
 
111
111
  #
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Backup
4
- VERSION = '0.0.15'
4
+ VERSION = '0.0.16'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup-remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Ivak, Michael van Rooijen