Incrementing the date depending on the Counter (parameter) passed to the script

Hello Everyone,

I have been trying to complete a shell script where, I need to increment the date depending on the file (depending on the date) availability on the remote server.
i.e.
Basically, I will be passing a counter (like parameter 1 or 2 or 3 or 4).
First I will check for the availability of 7days file on the remote server.
If the file is not available then depending on the counter, the script should increment the date and check for the files (zip & non-zip) on the remote server.

For example:
Day=`date -d'1 week ago' +%Y%m%d`
bd=$Day

If the script is running on 10/14/2011, then I am calculating the Day value as 10/07/2011 and the file name as 
file='fixed.out.'$bd.'gz' i.e. file='fixed.out.20111007.'gz'
ssh  remote_cmp 'ls -ltr /home/brittany/$file'  --> to check whether the file is available on the remote server.

if [[ $? -ne 0 ]]
then
<1.If the counter (parameter) is 1, I need to increment the date to +1 i.e. the new date would be 10/08/2011 and 
     then check if the file is available (check for zip file and non zip file) on the remote host.
2. If the counter is 2, I need to increment the date to +2 i.e. the new data would be 10/09/2011 and 
      then check if the file is available (check for zip file and non zip file) on the remote host.
3. ..... so on until counter is 4 >

Could someone please share the thoughts how can I increment the date, i.e. set the new date to the variable and
then check for the files on the remote host.

Really appreciate your thoughts.

since your command date supports -d option, you can set the 7 days by this way.

Code is not tested

for d in 1 2 3 4 5 6 7
do
  Day=`date -d "$d day ago " +%Y%m%d`
  file="fixed.out.$Day"
  if [ -f "$file.gz" ]; then 
      echo "$file.gz is exist"
  esle
      if  [ -f "$file" ]; then
          echo "$file is exist"
      else
          echo "file.gz and $file are both not exist"
      fi
  fi
done