The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
new account, not recieving email to confirm denn Forum Support Area for Unregistered Users & Account Problems 1 07-10-2007 02:21 PM
Why am I not recieving email notification? Kelam_Magnus Post Here to Contact Site Administrators and Moderators 6 09-03-2002 10:01 PM
Problem with mail Colf UNIX for Dummies Questions & Answers 2 07-22-2002 01:47 AM
mail problem (NOT Mail or Mail.app) chenly UNIX for Dummies Questions & Answers 1 05-29-2002 12:59 PM
E-mail problem guest100 UNIX for Dummies Questions & Answers 6 10-26-2001 08:14 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-09-2006
pankajkrmishra pankajkrmishra is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 55
Mail recieving problem

Hi

I have been trying to resolve this issue refering to all your previous post..... but had a hard luck. Below is the code which is when run from command prompt sends the mail taking the mail related crediantials ( email id where to send the mail ) from a xml file whose path is mentioned in RUNTIME_OPTIONS as -Dconfig.file=$CONFIG_HOME/batch.xml.

Please see the code :
Code:
**********************************************************
#!/bin/ksh
#
#     This Script will Start Policy Verification 
###########################################
cd /opt/bea/wls61/config/dev05/batch_automation/batchPolicy 
JAVA_HOME=/opt/bea/jdk131
WL_HOME=/opt/bea/wls61
INSTANCE=dev05
FRAMEWORK_LIB=$WL_HOME/config/$INSTANCE/lib/com/fits
SERVICE_HOME=$WL_HOME/config/$INSTANCE/services
BATCH_HOME=$WL_HOME/config/$INSTANCE/batch_automation/lib
CONFIG_HOME=$WL_HOME/config/$INSTANCE/batch_automation/config

CLASSPATH=.:$BATCH_HOME/batch.jar:$BATCH_HOME/classes12.jar:$SERVICE_HOME/plus/lib/com/fits/plus.jar:$SERVICE_HOME/diary/lib/com/fits/diary.jar:$FRAMEWORK_LIB/FitsUtil.jar:$FRAMEWORK_LIB/FitsFramework.jar:$FRAMEWORK_LIB/jdom.jar:$BATCH_HOME/NetComponents.jar:$FRAMEWORK_LIB/xercesImpl.jar:$FRAMEWORK_LIB/customerService.jar:$SERVICE_HOME/numbering/lib/numberingService.jar:$SERVICE_HOME/question/lib/com/fits/QuestionEngine.jar:$WL_HOME/lib/weblogic.jar:$SERVICE_HOME/ios/lib/ios.jar:$BATCH_HOME/AccountService.jar:$BATCH_HOME/AddressService.jar:$BATCH_HOME/Producer.jar:$FRAMEWORK_LIB/FITSDBPool.jar

BATCH_LIB=$BATCH_HOME/lib

CLASSPATH=$BATCH_HOME/claims.jar:$BATCH_HOME/mail.jar:$BATCH_HOME/activation.jar:$CLASSPATH

RUNTIME_OPTIONS="-Dconfig.file=$CONFIG_HOME/batch.xml  -Duser.timezone=America/New_York -Djava.naming.factory.initial=weblogic.jndi.T3InitialContextFactory -Djava.naming.provider.url=t3://172.16.18.149:8005 -Djava.naming.security.principal=system -Djava.naming.security.credentials=mfxclaims"

mv ./logs/200* ./logs/bak
echo RUNTIME_OPTIONS=$RUNTIME_OPTIONS
echo CLASSPATH=$CLASSPATH

$JAVA_HOME/bin/java $RUNTIME_OPTIONS -cp $CLASSPATH com.fits.service.claimservice.batch.policyverification.BatchPolicyVerificationMain  $1 $2 $3 > logs/batchPolicy.log  2>&1
*********************************************************
Now above script when run as ./startBatchPolicy.sh sends the mail refering to batch.xml file ( looks for email id to which mail has to be sent ) .


Now what I did is, instead of declaring the variables in the same script , I made a common script & invoked this common script in other script.

Following is the common script ( batch_settings.sh that contais all common variable settings ):

Code:
*********************************************************
##########################################################
#! /bin/ksh
# This is setting file invoked by  each batch job. 
#
###########################################################

export JAVA_HOME=/opt/bea/jdk131
export BEA_HOME=/opt/bea
export WL_HOME=/opt/bea/wls61
export INSTANCE=dev05
export FRAMEWORK_LIB=$WL_HOME/config/$INSTANCE/lib/com/fits
export SERVICE_HOME=$WL_HOME/config/$INSTANCE/services
export CONFIG_HOME=$WL_HOME/config/$INSTANCE/batch_automation/config
export BATCH_HOME=$WL_HOME/config/$INSTANCE/batch_automation
export COMMON_LIB=$BATCH_HOME/lib
export WL_LIB=$WL_HOME/lib
export APP_HOME=$WL_HOME/config/$INSTANCE
export SECURITY=$APP_HOME/applications/securityframework
export INITIAL_CONTEXT_PROVIDER=t3://172.16.18.149:8005

export CLASSPATH=.:$WL_HOME/lib/weblogic.jar:$COMMON_LIB/mail.jar:$COMMON_LIB/activation.jar:$COMMON_LIB/batch.jar:$COMMON_LIB/claims.jar:$COMMON_LIB/wlicommon.jar:$COMMON_LIB/docucorp.jar:$COMMON_LIB/security.jar:$COMMON_LIB/AddressService.jar:$COMMON_LIB/ais.jar:$COMMON_LIB/Producer.jar:$COMMON_LIB/classes12.jar:$COMMON_LIB/AccountService.jar:$COMMON_LIB/NetComponents.jar:$COMMON_LIB/customerservice.jar:$COMMON_LIB/castor.jar:$COMMON_LIB/claims-container.jar:$COMMON_LIB/ids.jar:$COMMON_LIB/jdom.jar:$COMMON_LIB/numberingService.jar:$COMMON_LIB/plus.jar:$COMMON_LIB/diary.jar:$COMMON_LIB/ais.jar:$COMMON_LIB/DocucorpMsg.jar:$COMMON_LIB/MbpsBatch.jar:$COMMON_LIB/dom4j.jar:$COMMON_LIB/commons-logging.jar:$COMMON_LIB/cglib2.jar:$COMMON_LIB/commons-lang.jar:$COMMON_LIB/FitsFramework.jar:$COMMON_LIB/FitsUtil.jar:$COMMON_LIB/hibernate2.jar:$COMMON_LIB/jdbc2_0-stdext.jar:$COMMON_LIB/jta.jar:$COMMON_LIB/junit.jar:$COMMON_LIB/odmg.jar:$COMMON_LIB/QuestionEngine.jar:$COMMON_LIB/xerces.jar:$COMMON_LIB/jxl.jar:$COMMON_LIB/ibatis-sqlmap-2.jar:$COMMON_LIB/ibatis-common-2.jar:$COMMON_LIB/xercesImpl.jar:$COMMON_LIB/DocService.jar:$FRAMEWORK_LIB/FitsUtil.jar:$FRAMEWORK_LIB/customerservice.jar:$FRAMEWORK_LIB/jdom.jar:$FRAMEWORK_LIB/FitsFramework.jar:$FRAMEWORK_LIB/FITSDBPool.jar:$FRAMEWORK_LIB/xercesImpl.jar:$SERVICE_HOME/ios/lib/ios.jar:$SERVICE_HOME/numbering/lib/numberingService.jar:$SERVICE_HOME/plus/lib/com/fits/plus.jar:$SERVICE_HOME/diary/lib/com/fits/diary.jar:$SERVICE_HOME/account/lib/AccountService.jar:$SERVICE_HOME/account/lib/AddressService.jar:$SERVICE_HOME/question/lib/com/fits/QuestionEngine.jar:$CONFIG_HOME

export RUNTIME_OPTIONS="-Dconfig.file=$CONFIG_HOME/batch.xml -Duser.timezone=America/New_York -Djava.naming.factory.initial=weblogic.jndi.T3InitialContextFactory -Djava.naming.provider.url=$INITIAL_CONTEXT_PROVIDER -Djava.naming.security.principal=system -Dbea.home=$BEA_HOME -Dlog.dir=./logs -Djava.naming.security.credentials=mfxclaims"

*********************************************************
Below is the script that envokes the above script ie batch_settings.sh.

Code:
***************************************

#! /bin/ksh
#
#     This Script will Start Policy Verification 
###########################################
cd /opt/bea/wls61/config/dev05/batch_automation/batchPolicy 
.  /opt/bea/wls61/config/dev05/batch_automation/batch_settings.sh

mv ./logs/200* ./logs/bak
echo RUNTIME_OPTIONS=$RUNTIME_OPTIONS
echo CLASSPATH=$CLASSPATH


$JAVA_HOME/bin/java $RUNTIME_OPTIONS -cp $CLASSPATH com.fits.service.claimservice.batch.policyverification.BatchPolicyVerificationMain  $1 $2 $3 > logs/batchPolicy.log  2>&1 &

************************************************************
Now with this optimized code evrything is ok except that it is not sending mail as the uppermost code used to....... I am really confused....... Any help will be highly appreciated..........

Thanks

Pankaj

Last edited by vino; 08-09-2006 at 01:32 AM.. Reason: Always put your code within the code tags.
  #2 (permalink)  
Old 08-09-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Do all the three scripts appear just like the above in the actual script ?

Because, the shebang #! /bin/ksh should ALWAYS be the first line of the script.
  #3 (permalink)  
Old 08-09-2006
pankajkrmishra pankajkrmishra is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 55
Hi

Yeah All the script starts with

#!/bin/ksh.

Regards
Pankaj
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0