I want to be able to refer to the julian date the convert back to calendar date.
I have a cron script which does the following:
DATE=`date +%Y%m%d`
YESTERDAY=`expr $DATE – 1`
# Copy charge file to out directory…
cp $SOURCEDIR$YESTERDAY$FILENAME.* $HOMEDIR$ODIR
Well, this works well until the last day 1st of every month. I need a way to set the variable YESTERDAY to the true day before the last day of the month, i.e. if today is 20050301, YESTERDAY should be 20050228 but the current cron script sets YESTERDAY to 20050300 which is an invalid date…
Thanks all,
– Rob