nkaul / pdsh

Automatically exported from code.google.com/p/pdsh
GNU General Public License v2.0
0 stars 0 forks source link

output to named file[s] #57

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be really useful to be able to split output by host into separate 
files. While this is undoubtedly possible with some bashfu, integration into 
pdsh would be better. I'm imagining something like this:

$ pdsh -w "192.168.2.4[6-9]" -o foo/HOSTNAME.out hostname
$ ls foo/
192.168.2.46.out   192.168.2.47.out   192.168.2.48.out   192.168.2.4.9.out
$ cat foo/192.168.2.46.out
bar.example.com
$

In this instance, HOSTNAME (or some other token) would be used as a replacement 
token.

Original issue reported on code.google.com by morga...@gmail.com on 2 Apr 2013 at 8:16

GoogleCodeExporter commented 8 years ago
Have you checked out the dshbak(1) script distributed with pdsh?
It can do what you want I believe:

$ dshbak  -h
Usage: dshbak [OPTION]...
 -h       Display this help message
 -c       Coalesce identical output from hosts
 -d DIR   Send output to files in DIR, one file per host
 -f       With -d, force creation of DIR

Please let me know if that does not work for you. Also, if you have a good 
argument for including this feature directly in pdsh, go ahead and include it 
here.

Thanks!
mark

Original comment by mark.gro...@gmail.com on 2 Apr 2013 at 9:34

GoogleCodeExporter commented 8 years ago
It's the first I've heard about it. it'll do for my purposes, but at the end of 
the day dshbak feels like a workaround for a missing pdsh feature :)

I wish I could make a good argument for it (other than "it'd be super useful 
and feels like it should be a core feature"), but it isn't coming to me.

Original comment by morga...@gmail.com on 3 Apr 2013 at 1:25