Problem in Weekly file Transfer script

I have made a script which transfers some files of the entire week , but the script fails when the next month is started.
For e.g; if i run the script on 5th may , but i need to transfer files of its previous week which is from 24th April to 30th april ,the script fails, i have this loop in the script

dt_2=`TZ=CST+$dt date +%Y-%m-%d` 
 

I just put values in $dt which gives me the date to which i need to transfer the files.
For e.g; Considering current date as 2011-05-05, i need to go to date 30th april onwards to 24th april then
24 * 5 = 120

`TZ=CST+120 date +%Y-%m-%d`  

will give me date 2011-04-30.

But the problem here is i am not getting the correct count value,
since i have used cnt1=`expr $1 - $2` which is subtracting two date values , but this does not work for the e.g; which i mentioned above
Could you suggest me a solution on this.
Would appreciate your assistance.

Use my datecalc script. It makes date calculations easy.

$ cat last-week
#! /bin/ksh

alias datecalc=./datecalc
year=$1
month=$2
day=$3
dow=$(datecalc -d $year $month $day)
mjd=$(datecalc -j $year $month $day)

(( mjd2=mjd-(dow+1) ))
(( mjd1=mjd2-6 ))

datecalc -j $mjd1
datecalc -j $mjd2
exit 0
$
$
$ ./last-week 2011 5 1
dow = 0
2011 4 24
2011 4 30
$

Are you trying to generate filenames which contain a date?

Assuming that this is a process which is going to run week-on-week fiirst impressions are that this may be easier if you have a daily cron at say 23:58 which finds and appends that days filenames in a filelist file. At say 23:59 on the last day of the week have another cron which renames filelist as filelist.lastweek and nulls filelist ready for the new week. Then the following Thursday you have a filelist.lastweek ready to use.