人力検索はてな
モバイル版を表示しています。PC版はこちら
i-mobile

連続でscp転送すると必ず1013個目でハングアップします。

サーバA:Fedora Core 6 32bit
サーバB:Cent OS 5.8 32bit

サーバAにあるファイル群をサーバBにリネームしながら scp 転送するために、サーバB上の hoge.sh に

#!/bin/sh
scp (user)@A:(remote path) (local path)


のように scp コマンドを羅列して hoge.sh を実行しています。

全体で3000個ぐらいのファイルを転送したいのですが、何故か毎回先頭から1013個目でハングアップしてしまいます。
原因・解決方法がおわかりの方、回答をいただきたいです。

補足:
・hoge.sh はプログラムが自動で生成します。起動は手動です。
・サーバBからサーバAへは鍵認証で接続できるようになっています。
・転送するファイルの順番を変えても、ファイル名を変えても、毎回1013個目でハングアップしています。
・ハングアップした状態で、hoge.sh を Ctrl+C で抜けてコマンドプロンプトから手動で scp を叩いても、ハングアップします。
・再度サーバBにSSH接続しなおすと、また scp できるようになります。
・サーバAが Cent OS 5.8 でも同じ事象になります。

●質問者: yellow_owl
●カテゴリ:コンピュータ
○ 状態 :終了
└ 回答数 : 1/1件

▽最新の回答へ

質問者から

長すぎて質問本文の中に書けなかったことを補足します。

・ハングアップした時の scp -v で出たログは以下の通りです。SSH2_MSG_SERVICE_ACCEPT receivedで止まってしまっているようです。

$ scp -v -P (port) (user)@(domain):(remote path) (local path)
Executing: program /usr/bin/ssh host xxx.xxx, user xxx, command scp -v -f (local path)
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to xxx.xxx [xxx.xxx.xxx.xxx] port xxxxx.
debug1: Connection established.
debug1: identity file /home/xxx/.ssh/identity type -1
debug1: identity file /home/xxx/.ssh/id_rsa type -1
debug1: identity file /home/xxx/.ssh/id_dsa type 2
debug1: loaded 3 keys
debug1: Remote protocol version 1.99, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /home/xxx/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received


1 ● うぃんど
●300ポイント ベストアンサー

CentOS側で ulimit -a してみてください。

デフォルトのままだと open files が 1024 になってるはずですから、
ulimit -n4096 などで変更して対応することになるでしょう。


yellow_owlさんのコメント
ありがとうございます。この方法で無事解決できました。
関連質問

●質問をもっと探す●



0.人力検索はてなトップ
8.このページを友達に紹介
9.このページの先頭へ
対応機種一覧
お問い合わせ
ヘルプ/お知らせ
ログイン
無料ユーザー登録
はてなトップ