2011年2月21日月曜日

シェルスクリプト:postgresqlのSQL実行

/usr/local/pgsql/bin/psql -h localhost -U user test_db
SELECT * FROM test_table;
_EOF

2011年2月10日木曜日

シェルスクリプト:複数サーバのログをtailする

#!/bin/bash

FILE = $1

for box in box1.foo.com box2.foo.com box3.foo.com box4.foo.com; do

ssh $box tail -f $FILE &

done

wait