SunCluster oneliner: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Kategorie:SunCluster|Einzeiler|Oneliner]]
[[Category:SunCluster|Einzeiler]]
==Resource Groups to remaster==
==Resource Groups to remaster==
<source lang=bash>
<syntaxhighlight lang=bash>
# /usr/cluster/bin/clrg status | \
# /usr/cluster/bin/clrg status | \
/usr/bin/nawk '
/usr/bin/nawk '
Line 26: Line 26:
   }
   }
}'
}'
</source>
</syntaxhighlight>

Latest revision as of 03:02, 26 November 2021

Resource Groups to remaster

# /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;
  }
}'