We use the windows scheduler along with cygwin example files below:
create a bat to be placed in MS scheduler like:
set
path=%PATH%;d:\RefreshDB\CYGNUS\cygwin-b20\H-i586-cygwin32\bin;D:\Refres
hDB\blat
REM
sh checkerrors.sh
exit
create a shell script like:
ERRORFOUND=0
grep -i 'EXP-' //D/RefreshDB/logs/expmcprod.log >
//D/RefreshDB/logs/errorsOnly.log
if [ $? -eq 0 ]
then
ERRORFOUND=1
fi
#
ERRLINE=`grep -i 'IMP-' //d/RefreshDB/logs/impmcprod.log | grep -v
"error 2270" | wc -l`
if [ $ERRLINE -gt 6 ]
then
ERRORFOUND=1
grep -i 'IMP-' //d/RefreshDB/logs/impmcprod.log | grep -v "error 2270"
>> //D/RefreshDB/logs/errorsOnly.log
if [ $? -eq 0 ]
then
ERRORFOUND=1
fi
fi
#
grep -i 'error' //D/RefreshDB/logs/Refresh.log >>
//D/RefreshDB/logs/errorsOnly.log
if [ $? -eq 0 ]
then
ERRORFOUND=1
fi
#
if [ $ERRORFOUND -eq 1 ]
then
blat logs/errorsonly.log -t somewhocares
fi
Amy Loukota
Oracle Certified DBA
TriWest HealthCare Alliance
15451 N. 28th Ave.
Phoenix, AZ 85053
[Email address protected]
work: 602-564-2452
"The best job goes to the person who can
get it done without passing the buck
or coming back with excuses."
-- Napoleon Hill, Author and Speaker
-----Original Message-----
From: White Steve R.
[mailto:oracledba-ezmlmshield-x6807480.[Email address protected]
Sent: Tuesday, May 30, 2006 9:52 AM
To: LazyDBA Discussion
Subject: RE: SQLPLUS / CYGWIN
I am not sure what other things your DOS batch job does BUT,
I used to use a CYGWIN BASH script to run sql scripts and ran these
under the CYGWIN "cron.exe" background process. Basically I used my
Microsoft desktop to mimic UNIX to run cron jobs.
-----Original Message-----
From: Brett N Exton
[mailto:oracledba-ezmlmshield-x61830883.[Email address protected]
Sent: Tuesday, May 30, 2006 11:56 AM
To: LazyDBA Discussion
Subject: SQLPLUS / CYGWIN
I apologise for asking this question in an Oracle forum when my query is
not
Oracle related so I'll take my slap on the wrist willingly.....
However, I want to use a Dos batch file to run a Cygwin shell script
which in
turn does some SQL stuff etc. However, I'm not having much luck getting
the
batch file to call the shell script.
Does anybody know the syntax I need to use
Many thanks & Apologies
--
Brett
________________________________________________________________________
This e-mail and any attachments transmitted with it represents the
views of the individual(s) who sent them and should not be regarded
as the official view of Bridgend County Borough Council. The contents
are confidential and intended solely for the use of the addressee. If
you have received it in error, please inform the system administrator
on (+44) 01656 642111.
This e-mail and any attachments have been scanned with 'MessageLabs
SkyScan' - http://www.messagelabs.com/
________________________________________________________________________
Maer'r e-bost hwn ac unrhyw atodiadau a drosglwddir gydag ef yn
cynrychioli
safbwyntiau'r unigolyn (unigolion) a'u hanfonodd ac ni ddylid eu
hystyried fel
safbwynt swyddogol Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr. Mae'r
cynnwy
syn gyfrinachol ac wedi'i fwriadu at ddefnydd y person y'i cyfeiriwyd
ato yn
unig. Os ydych wedi ei dderbyn mewn camgymeriad, rhowch wybod i
weinyddwry system ar (+44) 01656 642111.
Mae'r e-bost hwn ac unrhyw atodiadau wedi cael eu sganio gyda
'MessageLabs SkyScan' - http://www.messagelabs.com/
________________________________________________________________________
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
The information contained within this transmission is proprietary and protected pursuant to federal regulations; it is intended only for the use of the individual or entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any distribution, copying, disclosure, use of, or reliance on, the contents of this transmission is strictly prohibited.
If you have received this communication in error, please notify the sender immediately by telephone and permanently delete the original message, attachments and all copies. Thank you.
Oracle LazyDBA home page