UNIX Script for Sending Oracle Concurrent program Output or log file

| No Comments | No TrackBacks

To email a concurrent program PDF output. We need to call a UNIX host script to read the file from Oracle output directory and using UNIX command mailx, send the output as an attachment to the email address. 

UNIX script for sending email:

 

#====================================================== =====

# derive settings

#====================================================== =====

 

FILE_IN_BASE=o${V_CURRENT_REQ_ID}.out # output file generated by Application

FILE_ERR_BASE=l${V_CURRENT_REQ_ID}.log # log file generated by Application

FILE_OUT=${APPLCSF}/${APPLOUT} # output file directory

FILE_LOG=${APPLCSF}/${APPLLOG} # log file directory

FILE_IN=${FILE_OUT}/${V_FILE_NAME}

FILE_ERR=${FILE_LOG}/${FILE_ERR_BASE}

 

#====================================================== =====

#Email Body

#====================================================== =====

#MESSAGE="Test Message"

#====================================================== =====

#Check for Outfile Validity and existence

#====================================================== =====

 

DATAFILE_COUNT='ls -l $FILE_IN | wc -l'

 

if [ $DATAFILE_COUNT -eq 1 ]

then

echo "file!"

fi

 

if [ $DATAFILE_COUNT -lt 1 ]

then

echo "No input file exists"

exit 1

fi

 

echo ======================================================= ========

echo "Emailing Outfile "

echo ======================================================= ========

 

uuencode $FILE_IN Output.pdf| mailx -s "Test Request Output " $V_EMAILID

 

exit 0

#====================================================== =====

No TrackBacks

TrackBack URL: http://chandramouly.com/MT/mt/mt-tb.cgi/11

Leave a comment

About this Entry

This page contains a single entry by chandramouly published on April 27, 2010 2:45 PM.

Oracle Customer Master Updates - HZ Party Site and Locations was the previous entry in this blog.

Oracle XML Publisher Bursting Sample Program is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.