help with multiple loops in shell script

Hi Guys-

I'm trying to write a script which takes date as input (mm.yy.dd) and search in the current file. If pattern doesn't exist it will then look in a backup directory and so on.

being a newb i'm unable to loop over to the backup directory. hoping for some ideas, i've highlighted the area where i'm stuck . any advice is appreciated.
I have about mutiple backup directories in the root_dir and the script should keep searching until it runs out of directories.

the naming convention of backup directories is backup-yyyy.mm.dd


#!bin/bash

datetime=$1
root_dir=/home/xyz
bkup_dir=`ls -tr | grep -i "backup-" | tail -1
pattern=`grep "$datetime" $root_dir/logfile

if [ $pattern = "" ]
then "go into bkup folder and search for pattern "
else
   echo -e $pattern
fi

"go into bkup folder and search for pattern "

to

 
find $bkup_dir -type f | xargs grep -l "$datetime"