Date Not appending in log file

Hi experts . . .

Sunsolaris 9 version

I have the script as below:

Am getting log file as : archive_today_.log

Please suggest.

##################################################
set 'date'
dd=$3
mon=$2
export mon
yyyy=$6
export yyyy

cd /oracle/P47/saparch

LOG_FILE=/oracle/P47/saparch/archive_today_$date.log
echo "*******************************************************************">> $LOG_FILE

date >> $LOG_FILE

sqlplus "/as sysdba"<< EOF >> $LOG_FILE
set serveroutput on ;
set time on ;
recover automatic standby database;
CANCEL
exit
EOF

echo "Finish applying archives in SAP DR site..." >> $LOG_FILE

echo " ----------------------------------------------------------">> $LOG_FILE

echo "End SAP DR script " >> $LOG_FILE
echo "=========================================================" >> $LOG_FILE.....................................................................................................

Hi,
Am I completely misunderstanding the problem here maybe? But the variable 'date' is never set anywhere ?!

Why not :
datestamp=$(date +'%d%m%Y')
LOG_FILE=/oracle/P47/saparch/archive_today_$datestamp.log
...

Hi domivv,

thanks for reply . . . I modified like this:
#set 'date'
datestamp=$(date +'%d%m%Y')
dd=$3
mon=$2
export mon
yyyy=$6
export yyyy

cd /oracle/P47/saparch

LOG_FILE=/oracle/P47/saparch/archive_today_datestamp.log

I got following error:

archives_apply.sh: syntax error at line 11: `datestamp=$' unexpected

This is KSH syntax,You may try it with datestamp=`date +'%d%m%Y'`

Thanks
Nagarajan G

Hi Nagrajan,

now script is like:

#set 'date'
datestamp='date +'%d%m%Y''
dd=$3
mon=$2
export mon
yyyy=$6
export yyyy

cd /oracle/P47/saparch

LOG_FILE=/oracle/P47/saparch/archive_today_datestamp.log

and output log file is:

archive_today_datestamp.log it is not picking date values. . .

rgds