for d in $SRC_DIR; do
cd $d
if [ -e $VERSION_FILE ]; then
version=`cat $VERSION_FILE`
if [ "$version" != "" ]; then
for f in `find . -path "*_v${version}"`; do
dirpath=`echo $d | rev | cut -d / -f1,2 | rev | sed 's/\//-/'`
cleanname=`echo $f | cut -d / -f 2 | cut -d _ -f 1`
tar zcvfp $DST_DIR/PR-1-${DT}-V${version}-${dirpath}-${cleanname}.tgz $f > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "error in backup" # add better error handling here
fi
done
fi
fi
done