Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RSH COMMAND HELP

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
0
0
GB
HERE IS A COPY OF MY SCRIPT. THE PROBLEM IS THAT IT IS NOT QUITTING RSH EVEN THOUGH PROCESS HAS FINISHED ON REMOTE SERVER!!!

HENCE IT DOESNT QUIT OUT OF SCRIPT. HELP!?!?!?!


#!/bin/ksh

#
# Shell script to backup the entire system onto D(ave) L(ee) T(ravis) Drive
#

TODAY=`date +%d`;export TODAY

exec 1>/usr/local/lib/backups/backlog.$TODAY 2>&1

TAPERW=/dev/rmt/0c
TAPENR=/dev/rmt/0cn
TM=1

cd /
umask 000

# Shutdown the ORACLE database
echo "Shutting down the Oracle Database - `date`"
/user01/oracle/admin/scripts/clVIS

echo "Backup started at `date` ..."
for FS in `/usr/sbin/mount|awk '{ print $1 }'`
do
case "$FS" in
"/dev/fd"|"/tmp"|"/proc"|"/cdrom")
continue
;;
esac
echo "Backing up $FS to tape .. tapemark $TM .."
/usr/sbin/ufsdump 0uf $TAPENR $FS
TM=`expr $TM + 1`
sleep 10
done
# tar cvf /user04/prod_backup.tar /user0[2-4]/oradata/PRD1/*
# Startup the ORACLE database
echo "Starting up the Oracle Database - `date`"
/user01/oracle/admin/scripts/stVIS >/tmp/ora.open 2>&1


echo "Backup finished `date` ..."

rsh -n lsi /usr/local/bin/daily_backup;
mt -f $TAPERW rewoffl
cat /usr/local/lib/backups/backlog.$TODAY | lp -d 89_13
cat /usr/local/lib/backups/backlog.$TODAY | lp -d 89_6;
 
no, the problem is where it kicks off the rsh command ie the 4th line up from the bottom of the script!!

here it kicks off rsh on remote server (lsi), but once the script has finished on lsi rsh does not quit out on the server that kicked it off, hence the three lines below rsh command do not execute.
 
Don't know if this is the answer, but have your tried taking out the ; at the end of the rsh command. It would seem to me that perhaps rsh is trying to interpret the next command on the remote machine? Could be completely off base here, but you never know! Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top