0

I would like to upload multiple files to a remote machine in parallel. This is what I have tried so far based on the documentation

Net::SCP.start(ip, user) do |scp|
  channels = []
  dst = 'some_remote_location'

  stl_files.each do |f|
    channels << scp.upload(f, dst)
  end
  channels.each{|channel| channel.wait}
end

but I receive the following error

Error: #<Net::SSH::ChannelOpenFailed: open failed (1)>

I have also tried an alternative approach

Net::SSH.start(ip, user) do |ssh|
  channels = []
  dst = 'some_remote_location'

  stl_files.each do |f|
    channels << ssh.scp.upload(f, dst)
  end
  channels.each{|channel| channel.wait}
  ssh.loop
end

but the error is the same.

The blocking version scp.upload! or ssh.scp.upload! works as expected.

2
  • Have you tried sftp Commented Sep 6, 2018 at 7:15
  • The error seems like the remote does not identify localhost. Commented Sep 6, 2018 at 7:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.