Sto,
I looked into it on my 5.1 server and I had the same problem, but I noticed that it works on some images like STANDARD type, but not on ARCHIVE type.
Aanyhow I tried a few variations and came up with this short script to check.if it works on your system, I also modified your script so you wont have to type so much.
##############--CUT HEAR --#####################################
#!/bin/ksh
media=$1
NBADM=/usr/openv/netbackup/bin/admincmd
echo "Media $media contains following files:"
$NBADM/bpimmedia -l -mediaid $media | grep "^IMAGE" | awk {'print $4'} |
while read BID
do
ctime=`echo $BID | sed 's/^.*_//'`
$NBADM/bpflist -l -backupid $BID -ut $ctime | awk {'print $10'}
done
##############--CUT HEAR --#####################################
##############--CUT HEAR --#####################################
#!/usr/bin/ksh
IM=/tmp/imagelist
TODAYS_DATE=`date +%m/%d/%Y`
OFFSET=${1:-1}
case $OFFSET in
** | ???* | 3? | 29) print -u2 "Invalid input" ; exit 1;;
esac
eval `date "+day=%d; month=%m; year=%Y`
typeset -Z2 day month
typeset -Z4 year
machine=`hostname`
# Subtract offset from day, if it goes below one use 'cal'
# to determine the number of days in the previous month.
day=$((day - OFFSET))
if (( day <= 0 )) ;then
month=$((month - 1))
if (( month == 0 )) ;then
year=$((year - 1))
month=12
fi
set -A days `cal $month $year`
xday=${days}
day=$((xday + day))
fi
#print $year-$month-$day
echo "\nEnter a client to search: \n"
read STUFF
echo "\nAre you sure you want to search this client?\n"
#### Inputs required 1. client name and 4. backup type
bpimagelist -U -d $month/$day/$year -e $TODAYS_DATE -client $STUFF -idonly |awk '{print $8}' >$IM
for i in `cat $IM|sort`
do
echo
echo Backup ID: $i
ctime=`echo $i | sed 's/^.*_//'`
#echo $ctime
bpimagelist -U -backupid $i
#echo ----------------------------------------------------------------------------
echo List of tapes that contain Image $i
echo Primary Copy:
bpimagelist -l -backupid $i |grep "FRAG 1" |awk '{print $9;}'|sort -u
echo ----------------------------------------------------------------------------
echo Duplicate Copy:
bpimagelist -l -backupid $i |grep "FRAG 2" |awk '{print $9;}'|sort -u
echo ----------------------------------------------------------------------------
echo Top Level Directory list in this Image
#bpflist -U -d $month/$day/$year -client $STUFF -backupid $i -option ONLY_DIRS|sed 's/.*P=\(.*\)\ D=.*/\1/;'|egrep '^\/'|sed 1q
bpflist -l -client $STUFF -ut $ctime -option ONLY_DIRS
echo ----------------------------------------------------------------------------
done
##end of script
##############--CUT HEAR --#####################################
JD