If conditions need

Dear Expert,

Below code is for to take the backup of database by daily time stamp. I need vital help to make my script automatic sending me email if it sucess or fail.

echo on
@REM Seamonkey's quick date batch (MMDDYYYY format)
@REM Setups %date variable
@REM First parses month, day, and year into mm , dd, yyyy formats and then combines to be MMDDYYYY
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%dd%%mm%%yyyy%
exp USER/password@alias file='D:\Backup\%date%.dmp' log='D:\Backup\%date%.dmp  full=N

I want to put if conditions to check the logfile follwing things are

("error failed ora- warnings terminated" )

if exist send email failed else success.

Thanks in advance.

Thanks You,

can you give specifics about what is the log file name... or what will be the path for log file name...

Thanks for update ... here is the details given below., One more thing like to update this log file is generate with daily time stamp.

log='D:\Backup\%date%.log

cat $log | grep -iq "error failed ora- warnings terminated"
if [ $? -eq 0 ] ; then
           mail -s "subject" email@blahblah.com <log
fi

Thanks for update Vivek, But my scripts are running on windows server and cat command will not function on windows.Please suggest.

oh... i am not familiar with windows server... :frowning:

Its ok Vivek. Experts can anybody help me in this.