scp.py
scp.py copied to clipboard
Add a limit_bandwidth parameter to get and put function.
The timeout has to be increased to handle pauses happening at start. The more the bandwidth is limited, the more the timeout should be.
The -l
option is used by the openssh scp source but isn't sent to the sink. Are you sure this does anything on the receiving side? (the test doesn't confirm if the bandwidth is actually altered)
Yes it works. I've tested it with several different bandwidth, and iftop always confirm the values. But you're right, it's not sent to the sink. In fact, I think scp tries to download the first packets, evaluate the rate, and then wait between every packets to not go over the given limit. So the first seconds are very chaotic, and after the bandwith stabilizes. You won't see it on small files.