|
|
|
|
|
by fidz
4097 days ago
|
|
Thanks! This is really great trick. I will obviously use less +F for tailing single file. Meanwhile, tail -f still useful for simple tailing to multiple machine, like function dogfight_tail {
logfile=/var/log/nginx/access.log
pids=""
for box in 02 03; do
ssh lb$box tail -f $logfile | grep " 500 " & # find error machines
pids="$pids $!"
done
trap 'kill -9 $pids' SIGINT
trap wait
}
dogfight_tail
|
|