The UNIX and Linux Forums  

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
how to break within a case/esac and stay in script tumblez UNIX for Dummies Questions & Answers 4 04-12-2009 09:22 AM
Reset environment - ".. /etc/.environment dev_env" zzwu3591 UNIX for Advanced & Expert Users 7 01-12-2007 09:27 AM
Unix server will not stay up on the network jback UNIX for Dummies Questions & Answers 3 05-05-2005 02:45 PM
What can I do,if I want windows me and unix stay in the same computer? David UNIX for Dummies Questions & Answers 2 01-07-2001 12:44 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-18-2008
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
How does the environment stay set

I am running this pre-script with a post scripts that needs to share the same variables. How do I keep the environment variable settings for the next script to access from the RMAN Script?



Prescript #1


#RMAN Script
#!/bin/ksh
ORACLE_SID=INVPRD;export ORACLE_SID
DBNAME=$ORACLE_SID;export DBNAME
LOGDIR=/u01/app/oracle/product/10.2.0/scripts/logs/rman;export LOGDIR
CURRTIME=`date +"%y%m%d%H%M%S"`;export CURRTIME
LOGF=$LOGDIR/bkp_${DBNAME}_FULL_${CURRTIME}.log;export LOGF
START=`date +"%m/%d %H:%M"`
rman msglog $LOGF <<EOF


RMAN script# 2

connect target backup_admin/emcnw@INVPRD.WORLD
RUN {
ALLOCATE CHANNEL t1 TYPE 'SBT_TAPE';
backup database;
release CHANNEL t1;
}
exit;


Post script # 3

EOF
RC=$?
STATUS=OK
if [ $RC -ne 0 ]
then
STATUS=Error
fi
END=`date +"%H:%M"`
MSG="$STATUS $DBNAME RMAN_Full Backup $START-$END";export MSG
#mailx -s "$MSG " romptechteam@txu.com,vviswan1@txu.com < $LOGF
mailx -s "$MSG " vviswan1@txu.com < $LOGF
  #2 (permalink)  
Old 03-18-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,807
Source prescript #1 inside the RMAN script, or write a 3rd script to do this

Code:
#!/bin/ksh
. script1
RMAN

I can't get what script #3 does. But the idea is to get the ENV variables defined in #1 to persist.
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 02:59 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