Tuesday, June 12, 2012

grab that oneliner for sledgehammering with xargs and remote execute

Finally found the command on one node.... now how to grab that and execute it on milions of hosts (with a passwordless setup)
   66  ps auxww| grep Server | grep -v grep | awk '{ print $2 }' | xargs -i{} -t /usr/sbin/lsof -p {}  | grep wls10
Here you go
   77  history | grep Server | grep -v history | cut -c8- | grep wls10 | head -1 > ~/wls10.txt
   78  cat list | xargs -i{} -t ssh {} "$(<wls10.txt)"

1 comment:

  1. Using GNU Parallel you can do it in parallel. Last command will be:

    cat wls10.txt | parallel --slf list --onall

    --tag may be useful, too.

    Watch the intro videos to learn more: http://pi.dk/1

    ReplyDelete