Sponsored Content
Full Discussion: cannot open error
Top Forums UNIX for Dummies Questions & Answers cannot open error Post 302110595 by venu_cisco on Wednesday 14th of March 2007 02:49:08 AM
Old 03-14-2007
Hi
Thanks for your reply.Its working fine now.but while appending log information to log file its not working.

log file contains ONLY Following line:

ODSDEV Mon Mar 12 23:23:02 PDT 2007Expedites process Failed

Please see the code below

#:Name : Expedites_test.ksh
#:Path : /bin
#:Author : Venu Narapureddy
#Smilieate : 08-mar-2007
#Smilieescription : Script to extract and refresh Expeditesdata.
#:Frequency of job :Monthly
#:History:
#Smilieate: User: Modifications:
#:---------------------------------------------------------------------------
#:02-Jun-2006 Venu Narapureddy Initial version.
#:**************************************************************************
ORACLE_SID=ODSDEV export ORACLE_SID
ORACLE_HOME=/oracle/product/current export ORACLE_HOME
TNS_ADMIN=/var/opt/oracle export TNS_ADMIN
TOP='/users/qtcbi/metrics'; export TOP
MODULE_NAME='Expedites_test';export MODULE_NAME
ORAENV_ASK='NO';export ORAENV_ASK
LOG_FILE="$TOP/log/$MODULE_NAME.$(date +%m%d.%H:%M)"; export LOG_FILE
TMPFILE="/tmp/Expedites_test.lst"; export TMPFILE
NORMAL_MAIL='vnarapur'; export NORMAL_MAIL
ERROR_MAIL='vnarapur'; export ERROR_MAIL
UNAME='ccaisadm'; export UNAME # ORacle User ID
PWORD='changeit'; export PWORD # Oracle Password

echo "METRIX :Expedites : Extract of Expedites " |/bin/tee -a $LOG_FILE
echo "Current System Date Is : $(date) " |/bin/tee -a $LOG_FILE
echo "Script Is : $MODULE_NAME " |/bin/tee -a $LOG_FILE
echo "Working Directory Is : $(pwd) " |/bin/tee -a $LOG_FILE
echo "Host Machine Is : $(hostname) " |/bin/tee -a $LOG_FILE
echo "Oracle Instance Is : $ORACLE_SID " |/bin/tee -a $LOG_FILE
echo "$(date) Monthly job started " |/bin/tee -a $LOG_FILE
echo "$(date) Expedites extraction process Started " |/bin/tee -a $LOG_FILE
$ORACLE_HOME/bin/sqlplus $UNAME/$PWORD@$ORACLE_SID @$TOP/sql/Expedites.sql 25-oc
t-2006 29-oct-2006 |/bin/tee - a $LOG_FILE
errorcount=$(grep ORA - $LOG_FILE | wc -l)
if [[ $errorcount -gt 0 ]]; then
echo "$(date) Process Failed " |/bin/tee - a $LOG_FILE
/usr/bin/mailx -s "METRIX : EXPEDITES : $ORACLE_SID $(date)Expedites process Fai
led " $ERROR_MAIL </tmp/Expedites_test.lst > /dev/null
exit 1
else
echo "$(date) Process Done " |/bin/tee -a $LOG_FILE
/usr/bin/mailx -s "METRIX:EXPEDITES :$ORACLE_SID : LOG File for$(date) " $NORMAL
__MAIL <$LOG_FILE >/
dev/null
exit 0
fi
PWORD='changeit'; export PWORD # Oracle Password

echo "METRIX :Expedites : Extract of Expedites " |/bin/tee -a $LOG_FILE
echo "Current System Date Is : $(date) " |/bin/tee -a $LOG_FILE
echo "Script Is : $MODULE_NAME " |/bin/tee -a $LOG_FILE
echo "Working Directory Is : $(pwd) " |/bin/tee -a $LOG_FILE
echo "Host Machine Is : $(hostname) " |/bin/tee -a $LOG_FILE
echo "Oracle Instance Is : $ORACLE_SID " |/bin/tee -a $LOG_FILE
echo "$(date) Monthly job started " |/bin/tee -a $LOG_FILE
echo "$(date) Expedites extraction process Started " |/bin/tee -a $LOG_FILE
$ORACLE_HOME/bin/sqlplus $UNAME/$PWORD@$ORACLE_SID @$TOP/sql/Expedites.sql 25-oct-2006 29-oct-2006 |/bin/tee - a $LOG_FILE
errorcount=$(grep ORA - $LOG_FILE | wc -l)
if [[ $errorcount -gt 0 ]]; then
echo "$(date) Process Failed " |/bin/tee - a $LOG_FILE10
/usr/bin/mailx -s "METRIX : EXPEDITES : $ORACLE_SID $(date)Expedites process Failed " $ERROR_MAIL </tmp/Expedites_test.lst > /dev/null
exit 1
else
echo "$(date) Process Done " |/bin/tee -a $LOG_FILE
/usr/bin/mailx -s "METRIX:EXPEDITES :$ORACLE_SID : LOG File for$(date) " $NORMAL__MAIL <$LOG_FILE >/
dev/null
exit 0
fi

HiGHLIGHTED part only appending to LOG FILE...but i want all information in log file and as well as in body of the mail.

PLease guide me on this ....


Regards
Venu

Last edited by venu_cisco; 03-14-2007 at 03:56 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

error shutting down open bsd

The method I use to shut down my box is as follows : shutdown +3 -h logout the box indicates shutdown complete, so I switch off the power. When I reboot next time I get a Warning message in the bootup screen stating the that it was not shutdown correctly. being a newbie I'm kind of... (1 Reply)
Discussion started by: ferret
1 Replies

2. Solaris

ERROR: Can't open boot-device

Hi i need help pls ... Server type sun fire 3800 I need to install solaris 9 . When i boot the system i recieve the following : System Controller 'sunfire3800': Type 0 for Platform Shell Type 1 for domain A console Type 2 for domain B console Type 3 for... (5 Replies)
Discussion started by: tt155
5 Replies

3. Solaris

Error:: libm.so.2:open failed

Hi, I am working with solaris 9 and I want to install perforce on that,so I downloaded the p4v.bin file and try to install it by the command ./p4v after that it is giving the error--- ld.so.1: ./p4v.bin: fatal: libm.so.2: open failed: No such file or directory Killed I am not... (3 Replies)
Discussion started by: smartgupta
3 Replies

4. UNIX for Advanced & Expert Users

getting error when open vi editor

helo I install my product for koren language I m uisng RHEL -4 operating system now problem is whenever I open any file vi filename I got following error on the screen E557: Cannot open termcap file 'vt100' not known. Available builtin terminals are: builtin_ansi ... (1 Reply)
Discussion started by: amitpansuria
1 Replies

5. Red Hat

Error: Can't open display: :0.0

Hi, I get errors while running xclock from a non root user: # xclock --- this works fine # su - girish $ DISPLAY=:0.0; export DISPLAY $ xclock Xlib: connection to ":0.0" refused by server Xlib: No protocol specified Error: Can't open display: :0.0 $ I basically want to... (4 Replies)
Discussion started by: girish1428
4 Replies

6. Linux

ssmtp error : Cannot open <ip_address>:25

Hello, I am facing a problem with ssmtp mailing agent. I have installed and configured ssmtp in my RHEL5.3 system. I have written a shell script which sends mail to a couple of email id's. The script uses ssmtp to send mails. When I am running the scipt manually i.e. sh <script_name>.sh then... (3 Replies)
Discussion started by: senrooy
3 Replies

7. Shell Programming and Scripting

grep can't open error

Hi, Thanks for all your help. This forum is excellent. I just learnt PERL over the last few weeks by coding and asking questions.... I have one more. When I run my script I get the following error msg. The grep statement I have is `grep "Number of jobs processed:" output | sort -u |... (10 Replies)
Discussion started by: nurani
10 Replies

8. Solaris

Can't open boot_archive error message

Hello guys, Thanks for all your precious tips. I hope you can give me some advice again. This time I am having an issue with a SUN FIRE V240 (SOLARIS 10). The server doesn't boot, normally , first we had a file system error ====================+FIRST ERROR... (6 Replies)
Discussion started by: feg
6 Replies

9. Shell Programming and Scripting

Awk: can't open error

Hi , In a directory i've the files in the following format pay:year:mon:11789604 pay:year:mon:17675644 --- and i need to get 4th part of the above file name so i used awk command in the below code #!/bin/ksh for test_data in pay* do txt_awk = awk -F':' '{print $4;}' $test_data ... (7 Replies)
Discussion started by: smile689
7 Replies

10. UNIX for Dummies Questions & Answers

Error when using vim to open files

Hi all, 1st post here. I'm on Solaris and currently, I get the following error if I try to use vim to edit anything: Error detected while processing function <SNR>6_initialize: line 2: E697: Missing end of List ']': E116: Invalid arguments for function <SNR>6_defineOption line 3: E10:... (6 Replies)
Discussion started by: fred2028
6 Replies
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy