0

Is there a way to throttle the connection of a transfer with the ruby Net/SFTP library? I would like to leverage this to download some backups on a nightly basis, but don't want to eat up all of the server's bandwidth while doing so.

wmarbut
  • 4,595
  • 7
  • 42
  • 72
  • @theTinMan only thing that I had come to was doing QOS on **all** ssh connections, which didn't do what I wanted. – wmarbut Aug 20 '12 at 19:26

1 Answers1

1

Consider this sample from the Net::SFTP documentation:

# open and read from a pseudo-IO for a remote file
sftp.file.open("/path/to/remote", "r") do |f|
  puts f.gets
end

What would happen if you put a sleep inside that block?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303