12 ms·
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 machin
by fidz 12y 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