It is some time since I wrote any bash scripts but I think you may need something like:
cd <directory where the files are stored>
COUNT = `find . -name "*.gz" -size -10k -mtime -1 -print | wc -l`
if [ $COUNT -eq 0 ]
then
echo "The backup test has failed!" | mail -s "BACKUP FAILURE" myemail@gmail.com
fi
I'm not sure of the complete syntax but it should give you an idea. The
for
loop and
stat
command in your script do nothing so are not required.