それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

curlコマンドで速度制限(スピードリミッタ)をつける

curl でファイルを次々と取得してて

curl でパッケージを取得したり、転送したりしてて他の作業に支障がでることがあります。

curl 万能なので使いすぎます。

speed limit をつけることで curl を速度制限出来ます。

速度上限をつけることで、穏やかに、急がなくていいファイルはゆっくり転送しておくことが出来ます。便利

curl --limit-rate=2k $URL

また、遅すぎると切断するようなこともできますね。

wget の場合も同じものが使える。

http://takuya-1st.hatenablog.jp/entry/20110523/1306171106

参考資料

       --limit-rate <speed>
              Specify the maximum transfer rate you want curl to use - for both downloads and uploads.  This
              feature  is  useful  if  you  have a limited pipe and you'd like your transfer not to use your
              entire bandwidth. To make it slower than it otherwise would be.

              The given speed is measured in bytes/second, unless a suffix is appended.   Appending  'k'  or
              'K'  will  count the number as kilobytes, 'm' or M' makes it megabytes, while 'g' or 'G' makes
              it gigabytes. Examples: 200K, 3m and 1G.

              If you also use the -Y, --speed-limit option, that option will take precedence and might crip-
              ple the rate-limiting slightly, to help keeping the speed-limit logic working.

              If this option is used several times, the last one will be used.
      -y, --speed-time <time>
              If a download is slower than speed-limit bytes per second during a speed-time period, the download gets
              aborted. If speed-time is used, the default speed-limit will be 1 unless set with -Y.

              This option controls transfers and thus will not affect slow connects etc. If this  is  a  concern  for
              you, try the --connect-timeout option.

              If this option is used several times, the last one will be used.

       -Y, --speed-limit <speed>
              If  a  download  is  slower  than this given speed (in bytes per second) for speed-time seconds it gets
              aborted. speed-time is set with -y and is 30 if not set.

              If this option is used several times, the last one will be used.