#!/bin/ksh 
############################################################################
#  1.  On destination server edit /etc/inetd.conf and uncomment 'shell' line.
#  2.  Place servername and username in $HOME/.rhosts file.
#  3.  Restart inetd if changed.  'inetd -c'.
#  4.  Change DB and/or servername; make sure you have correct username and 
#      export parameters. 
#  5.  root 'mknod <pipename> p'  then chown  
############################################################################ 
#initialize variables
############################################################################ 
DB=OTG 
DESTINATION_SERVERNAME=stpprod2
USERID=SYSTEM
DESTINATION_FILE=/home/joelp/pipe/i${DB}pipe
export_file=/u01/app/oracle/joelp/pipe/e${DB}pipe
log_file=/u01/app/oracle/joelp/pipe/log/exp${DB}full.log

. /usr/local/bin/oraenvnew ${DB}
today=`date '+%y/%m/%d %H:%M:%S'` 

. $HOME/scripts/getpassword ${DB} ${USERID}
passwd=${password}

echo "KEYWORDGREP ${DB} Began at:  ${today}" 
echo "export_file = ${export_file}"
echo "log_file = ${log_file}"

nohup exp ${USERID}/${passwd} file=${export_file} log=${log_file} full=y consistent=yes compress=yes direct=y & 

cat ${export_file} | rsh ${DESTINATION_SERVERNAME} dd bs=4000b ">>" ${DESTINATION_FILE}

today=`date '+%y/%m/%d %H:%M:%S'` 
echo "KEYWORDGREP ${DB} Ended at:  ${today}"
