Curl abort transfer if (upload) speed is slower than
Is there a way to make curl abort transfer, if average speed of transfer (during POST) is slower than X.X KB/s? Some transfers get really, really slow and I would want them to restart. One of the easier ways would be take size of content to be u开发者_运维技巧ploaded and divide it by expected speed and assign this value into --max-time parameter. But this would have to wait whole expected duration of transfer before it would abort...
I am using command-line version of curl, but I wouldn't mind if solution could be done (or work around) in any popular languages already built-in Linux such as perl or python :)
By the way -Y/--speed-limit <speed>
didn't work for me, as it's probably only for download transfers.
-Y works for both upload and download and is used in combination with -y to set a condition of when to abort.
精彩评论