Saturday, April 12, 2008

Veritas Mirror volume notes

# ls -l
total 64
-rw-r--r-- 1 root other 119 Apr 11 01:21 a.sh
-rw-r--r-- 1 root other 151 Apr 11 20:48 b.sh
-rw-r--r-- 1 root other 78 Apr 11 20:48 tmp.out
-rw-r--r-- 1 root other 61 Apr 11 20:34 volume.txt
# cat a.sh
#! /bin/sh
vxdg -g oradg free | nawk '
{
if ($5/2/1024 > 0)
print "... Free chunk on "$1"("$2")"" " $5/2/1024, "MB"
}'
# cat b.sh
#! /bin/sh
for i in `cat volume.txt`
do
echo $i
df -k | grep $i > tmp.out
cat tmp.out | awk '{print "Volume ",$1, "Total size: " $2/1024 " Mb"}'
done
# cat tmp.out
/dev/vx/dsk/oradg/s33_redo2 2097152 1273531 772150 63% /db/stg33/redo2
# cat volume.txt
s33_dbf1
s33_dbf2
s33_dbf3
s33_dbf4
s33_redo1
s33_redo2
#

No comments:

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...