以前に axel で CLI 上から分割ダウンロードするというメモを書きました。 CentOS8 では標準リポジトリや EPEL では axel が提供されていません。 getpagespeed というリポジトリでは axel が提供されているのですが、getpagespeed リポジトリを使うには登録が必要のようです (未確認)。 その為、今回はソースコードから axel をインストールしました。
インストール
インストールは簡単です。 必要なライブラリやコンパイラが揃っていれば、ソースコードをダウンロードして ./configure && make && make install
するだけです。
curl -LO https://github.com/axel-download-accelerator/axel/releases/download/v2.17.7/axel-2.17.7.tar.gz tar zxvf axel-2.17.7.tar.gz cd axel-2.17.7/ ./configure && make && make install
これで axel がインストールされました。
# which axel /usr/local/bin/axel
現時点のバージョンは 2.17.7 でした。
$ axel --version Axel version 2.17.7 (linux-gnu) Copyright 2001-2007 Wilmer van der Gaast, 2007-2009 Giridhar Appaji Nag, 2008-2010 Philipp Hagemeister, 2015-2017 Joao Eriberto Mota Filho, 2016-2017 Stephen Thirlwall, 2017 Ismael Luceno, 2017 Antonio Quartulli, and others. Please, see the CREDITS file.
ダウンロードする
これで axel を使った分割ダウンロードが出来るようになります。 サーバ側に負荷がかかりすぎないよう、コネクションを調整しながら利用する必要があります。 デフォルトでは「5 コネクション」でダウンロードしようとするようです。
axel http://ftp.riken.jp/Linux/ubuntu-releases/18.04/ubuntu-18.04.4-live-server-amd64.iso
参考
ヘルプ
# axel --help Usage: axel [options] url1 [url2] [url...] --max-speed=x -s x Specify maximum speed (bytes per second) --num-connections=x -n x Specify maximum number of connections --max-redirect=x Specify maximum number of redirections --output=f -o f Specify local output file --search[=n] -S[n] Search for mirrors and download from n servers --ipv4 -4 Use the IPv4 protocol --ipv6 -6 Use the IPv6 protocol --header=x -H x Add HTTP header string --user-agent=x -U x Set user agent --no-proxy -N Just don't use any proxy server --insecure -k Don't verify the SSL certificate --no-clobber -c Skip download if file already exists --quiet -q Leave stdout alone --verbose -v More status information --alternate -a Alternate progress indicator --help -h This information --timeout=x -T x Set I/O and connection timeout --version -V Version information Visit https://github.com/axel-download-accelerator/axel/issues to report bugs