SunCluster oneliner

From Lolly's Wiki
Revision as of 16:52, 25 November 2021 by Lollypop (talk | contribs) (Text replacement - "[[Kategorie:" to "[[Category:")
Jump to navigationJump to search

Resource Groups to remaster

<source lang=bash>

  1. /usr/cluster/bin/clrg status | \

/usr/bin/nawk ' NR<=5 || ( NF>=3 && $(NF-1)=="Yes" ){

 next;

} NF==4 {

 rg=$1;
 primary=$2;
 if($NF=="Online"){
   printf "%20s\t%s on %s\n",rg,$NF,primary
 }
 while($0 !~ /^$/){
   getline;
   if($NF=="Online"){
     printf "%20s\t%s on %s, but not on primary %s\n",rg,$NF,$1,primary;
     list=list" "rg
   }
 }

} END{

 if(list != ""){
   printf "To fix it do:\n\tclrg remaster %s\n",list;
 }

}' </syntaxhighlight>