Looks like another issue at the MD5 section of code ...
Code:
# Create MD5 Checksums to verify archives after writing to media or network transfers
cd $ARCHIVEDIR
FILENAME=`ls -A "$BACKUPWEEK"_"$BACKUPNAME"_"$BACKUPDATE"_"$PREFIX"*`
if [ -e $FILENAME ]
then
echo "Creating MD5 Checksum for $FILENAME..."
$MD5SUM_BIN -b $FILENAME > "$FILENAME".md5
if [ "$?" -ne "0" ]
then
echo "MD5 Checksum failed!"
mail_log
exit 1
fi
else
echo "$FILENAME not found!"
echo "This should not happen"
mail_log
exit 1
fi
This needs a loop around it I believe in case the backup runs to more than one file.
I think this should work - but cannot test it right now myself.
Where FILENAME is currently assigned just once - make it get assigned from a loop. and add the do and done markers to the lines that need to be looped through.
Code:
# Create MD5 Checksums to verify archives after writing to media or network transfers
cd $ARCHIVEDIR
for FILENAME in `ls -A "$BACKUPWEEK"_"$BACKUPNAME"_"$BACKUPDATE"_"$PREFIX"*`
do
if [ -e $FILENAME ]
then
echo "Creating MD5 Checksum for $FILENAME..."
$MD5SUM_BIN -b $FILENAME > "$FILENAME".md5
if [ "$?" -ne "0" ]
then
echo "MD5 Checksum failed!"
mail_log
exit 1
fi
else
echo "$FILENAME not found!"
echo "This should not happen"
mail_log
exit 1
fi
done