2

What would be the cleanest way to execute same command remotely on several boxes with joint output to console?

For instance, I would like to tail logs from several boxes all together in my console as one output.

1
  • If you're asking how to do this from an interactive command line, that's a better fit for Unix & Linux than here. StackOverflow's scope is limited to software development. Commented Feb 19, 2018 at 16:16

1 Answer 1

3

Definitely GNU parallel is a nice tool for parallelizing things in the shell. It also has reasonable remote execution capabilities.

It can be as easy as

parallel -S $SERVER1 -S $SERVER2 echo ::: running on more hosts
Sign up to request clarification or add additional context in comments.

2 Comments

Running parallel --tag is useful here. Also, you can add servers using commas, -S $SERVER1,$SERVER2,$SERVER3
For tail -f you should also have a look at --line-buffer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.