Veritas-bu

[Veritas-bu] Available Tapes

2005-09-13 12:04:27
Subject: [Veritas-bu] Available Tapes
From: richard_hellier AT hotmail DOT com (Richard Hellier)
Date: Tue, 13 Sep 2005 17:04:27 +0100
Here's one way to simplify Smitha's script:

#! /bin/sh

PATH=$PATH:/usr/openv/volmgr/bin

cat << 'EEEOOOFFF'
         Pool           Occ     Empty
====================    ====    =====
EEEOOOFFF

vmquery -w -rn 0 | awk '
NR > 3 {
        pool = $12; date = $20;

        if (date == "00/00/0000") {
                ++unassigned[pool]
        } else {
                ++assigned[pool]
        }

        ++poolnames[pool]
}
END {
        for (p in poolnames) {
                printf "%20s\t%4d\t%5d\n", p, 0+assigned[p],
0+unassigned[p];

        }
}
' | sort


Cheers,

Richard.


<Prev in Thread] Current Thread [Next in Thread>