Computing.Net > Forums > Windows 2000 > WIN2K cmd file issue

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

WIN2K cmd file issue

Reply to Message Icon

Name: stant_98
Date: September 30, 2004 at 10:24:13 Pacific
OS: WIN2K
CPU/Ram: 2.5/2
Comment:

Hi all,

I am working with Oracle db backup and what I am trying to accomplish is to find an error message string in the temp. log file (cold_backup.txt) that the backup routine creates. In either case whether it finds it or not, I would like to send email (using blat util.) with notification in the subject line. Here is the part of the code that I am struggling with. Even when the there isn't any errors. I still get an email with subject that backup did not complete successfully:

set ALERT_LOG=E:\oracle\admin\remprod\bdump\ALERT_REMPROD.LOG
set ERRFILE=E:\oracle\admin\remprod\bdump\ALERT_ERRORS.TXT
set SUBJECT1=Database Backup Completed Successfully
set SUBJECT2=Database Backup did not Complete Successfully
set TEMP_ALERT_FILE=REMPRODALRT.LOG.TEMP
set TEMP_ALERT_LOG=E:\oracle\oradata\remprod\archives\cold_backup\cold_backup.txt

del /q E:\oracle\admin\remprod\bdump\ALERT_ERRORS.TXT

@echo off
if exist %TEMP_ALERT_LOG% findstr /n "corrupt Corrupt CORRUPT ORA- OSD- O/S-" %TEMP_ALERT_LOG% > %ERRFILE%
@echo on
blat %ERRFILE% -s "%SUBJECT2%" -t %EMAIL_ADDRESS_1%

if %ERRORLEVEL% = 1
blat %ERRFILE% -s "%SUBJECT1%" -t %EMAIL_ADDRESS_1%

VN



Sponsored Link
Ads by Google

Response Number 1
Name: pmkdatabase
Date: October 5, 2004 at 04:07:38 Pacific
Reply:

Viktor,

You might be better off posting in the programming forum.

I would use VB for this, so I am not really familiar with the syntax, but as one programmer to another, have you checked that this line does find the error text?

if exist %TEMP_ALERT_LOG% findstr /n "corrupt Corrupt CORRUPT ORA- OSD- O/S-" %TEMP_ALERT_LOG% > %ERRFILE%

If so, could the failure with the subject line be due to a timing issue? I would try with a PAUSE in the line after del /q....

Peter
(Alert me if you want a reply)


0
Reply to Message Icon

Related Posts

See More


Windows Media Player Play... remote command in W2K



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: WIN2K cmd file issue

cmd file as service www.computing.net/answers/windows-2000/cmd-file-as-service/22845.html

win2k installation issues www.computing.net/answers/windows-2000/win2k-installation-issues/58214.html

Win2k deleted file recovery www.computing.net/answers/windows-2000/win2k-deleted-file-recovery/8161.html