#author("2018-01-15T01:56:39+00:00","default:kazuma","kazuma") #author("2018-01-15T01:56:59+00:00","default:kazuma","kazuma") [[pssh]] *pssh [#n3601641] *** 概要 [#faa6419c] ** 概要 [#faa6419c] - パラレルでサーバーへコマンドを実行できます。 *** オプション [#k38b0e10] ** オプション [#k38b0e10] | -H | 単一ホスト | | -h | ホスト名が記載されたファイル名 | | -l | 認証ユーザー | | -A | パスワードを尋ねる | | -i | 標準出力とエラーをまとめて表示する | | -O | ssh のオプションを指定する | *** コマンドの実行 [#b6c3a4ee] ***** 例1 [#f6a48a11] ** コマンドの実行 [#b6c3a4ee] *** 例1 [#f6a48a11] $ pssh -H 192.168.100.100 -l testuser -A -i 'ls -l /home/testuser/test.txt' Warning: do not enter your password if anyone else has superuser privileges or access to your account. Password: [1] 17:11:46 [SUCCESS] 192.168.100.100 -rw-r--r-- 1 testuser testuser 868 5月 23 17:11 /home/testuser/test.txt ***** 例2 [#r2aafa65] *** 例2 [#r2aafa65] $ pssh -O StrictHostKeyChecking=no -x '-tt' -t 600 -h <(awk '{print $NF)' hostlist.txt) -i 'hostname' *pscp [#w15eb57f] *** 概要 [#uae8e2bd] - パラレルでファイルの転送できます。 *** ファイルを転送する [#e88333fa] pscp -H 192.168.100.100 -l USERNAME -A test.txt /tmp/test.txt 出力先のファイル名も指定してあげないと、エラーになってしまう。