its hard to find if you need it, but pretty fast to get when you know how :-)

 

#!/bin/bash
#DESC: write backup INDEX files with file names and vmname in it

DIRS='/srv/prox-bkp/bkp-vm-prd /srv/prox-bkp/bkp-vm-tst/dump'




for DIR in $DIRS
do
   cd $DIR || exit 1
   rm -f INDEX
   ls -1 vzdump-qemu-*.lzo >/dev/null 2>&1 && for f in vzdump-qemu-*.lzo 
   do 
      (echo -n "$f : "; lzop -d -c $f | strings | head | grep ^name: ) >> INDEX
   done
   ls -1 vzdump-qemu-*.tgz >/dev/null 2>&1 && for f in vzdump-qemu-*.tgz
   do 
      STATUS=UNKNOWN
      l=$(echo $f | rev | cut -d. -f2- | rev).log
      cat $l | grep -v INFO | wc -l | grep -q '^0$' && STATUS=OK || STATUS=ERROR 
      (echo "$f : $(gunzip -c $f | head | strings | grep ^name: ) : STATUS=$STATUS") >> INDEX
   done
done