I have managed to get copies working well between Windows and Linux
but I noticed that the libraries allow Asynchronous operation. I can
send Async commands and the loop till they complete but copies seem to
stay busy forever. Maybe I am just not cleaning up right (it does not
seem so)
ssh_session = Net::SSH.start(…etc…)
ssh_session.exec(“sleep 10”)
ssh_session.sftp.connect.upload(src_file, tgt_file)
ssh_session.loop(1) {
puts “I=#{interrupted} B=”+@ssh_session.busy?.inspect
not interrupted and @ssh_session.busy?
}
If the sleep is called (instead of the upload) it waits 10 secs and
then is not busy and wakes.
But the copy will not wake. Since I have hundreds of files to copy
I’d like to set them all off, do some other work, and then wait for
them to complete (rather than wait for them one at a time with
upload!) and then do the other work.
Any help would be appreciated… should I cleanup the “sftp.connect”?
How? When (if it is asynchronous)?
Thanks