LoginSignup
2
2

More than 5 years have passed since last update.

ファイルが多くscpに時間がかかる時の改善方法

Last updated at Posted at 2018-03-15

対象ファイルが多く scp で2分ぐらい転送にかかっていたのが、ssh + tar に置き換えたら 20秒ぐらいで終わるようになった。
同じ境遇の人のために、やり方.. コマンドをメモ

例) サーバ「hogehoge」に ~/tmp 配下をコピーする

(cd ~/tmp; tar cf - ./ 2> /dev/null | lzop -c | ssh hogehoge "lzop -d | tar xfm - -C ~/tmp")

ネットワーク上の転送量を抑えるため、lzop を使ってます。lz4でもよさげ。
lzop が使えない場合、gzipなどでも代用は可能だけど圧縮/解凍にかえって時間がかかる場合があるので要注意。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2