#!/bin/sh
#
# Sample script to produce a csv formatted list of volumes
# (on standard out) 
# Requires PresSTORE installed, usees the PresSTORE CLI
#
# See: http://www.archiware.com/pics/pdf/cli.pdf
# (c) 2011 Archiware, S.Koester    
#------------------------------------------------------------
                           
# Change the path in case PresSTORE is installed elsewhere                           
chatcmd="/usr/local/aw/bin/nsdchat -c"


list=`$chatcmd Volume names`    
echo "Label,Barcode,State,Mode,Type,'Used Size','Last Used',Location"

for i in $list
do
   c1=`$chatcmd Volume $i label` 
   c2=`$chatcmd Volume $i barcode` 
   c3=`$chatcmd Volume $i state`
   c4=`$chatcmd Volume $i mode`
   c5=`$chatcmd Volume $i mediatype`
   c6=`$chatcmd Volume $i usedsize`
   c7=`$chatcmd Volume $i dateused`
   c8=`$chatcmd Volume $i location`
   echo "'$c1','$c2','$c3','$c4','$c5','$c6','$c7','$c8'"
done

# EOF
   
   

