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.
Asked
Active
Viewed 369 times
1 Answers
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
-
looks like this does the trick! Thanks, that's an ingenuitive way to do things – wmarbut Aug 20 '12 at 19:25