1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

大きなファイルをscpすると接続がきれる場合の回避

Posted at

備忘

回線が細い環境で大きなファイルをリモートにscpしようとすると失敗することがあったが、以下によりcpできた。

ローカルmac(zsh)
リモートlinux

転送

while true
do
  rsync --partial --append --progress \
      -e 'ssh -o ServerAliveInterval=30 -o ServerAliveCountMax=10' \
      FILENAME REMOTEHOST:/PATH \
      && break
  sleep 10
done

失敗の都度、自動的に続きから再開してくれる。

送信完了後にもう一度検証(--checksum)

rsync --checksum --size-only --progress \
      -e 'ssh -o ServerAliveInterval=30' \
      FILENAME REMOTEHOST:/PATH    
1
0
2

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?