LinHES Forums
http://forums.linhes.org/

How to search for a file in multiple machines simultaniously
http://forums.linhes.org/viewtopic.php?f=5&t=21613
Page 1 of 1

Author:  manicmike [ Wed Sep 15, 2010 8:18 pm ]
Post subject:  Re: How to search for a file in multiple machines simultanio

I'd use something like this:

Code:
for i in host1 host2 host3 host4;do echo -n $i && ssh $i locate myfile;done


Mike

EDIT: I'd also have ssh keys set up so I didn't have to type in a password

Author:  tjc [ Wed Sep 15, 2010 9:35 pm ]
Post subject: 

To run it simultaneously the command would have to background each ssh process as it was launched and then wait for them all at the end... Of course if you're doing that, you'd also need some way to tell which machine the interleaved output is coming from.

Mike's serial solution is a good compromise. Since it uses locate the results from each machine should be fast and the output for it will be contiguous.

Author:  mattbatt [ Thu Dec 18, 2014 10:31 pm ]
Post subject:  Re: How to search for a file in multiple machines simultanio

The original post was a spammer that copy and pasted the question from a Linux forum
http://www.linuxforums.org/forum/newbie ... ously.html

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/