- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- running rsh from windows xp
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 12:03 AM
04-10-2006 12:03 AM
running rsh from windows xp
the exact command is this:
rsh hpux01 -l root /scripts/backup.ksh
which runs the script pasted below.
question: why does the lvsplit fail? when we run this from a normal shell, it works fine ... i thought it may be the env is not (and it may be the case) but when it view the env via "rsh hpux01 -l root env" it looks ok
--v--v--v--v-- snip --v--v--v--v--
#!/usr/bin/ksh
################################################################################
wlog() {
cdhome
echo "`date +%m/%d/%y\ %H:%M:%S` - $*" >> backup.$today.log
}
################################################################################
cdcachesys() {
cd /usr/cachesys
}
################################################################################
cdhome() {
cd /scripts/backup
}
################################################################################
send_wall_msg() {
wlog "========== BEGIN send_wall_msg"
cdhome
wall <<- EOF
System backup will begin in 60 seconds. Log off now or you will be logged off.
EOF
sleep 60
wall <<- EOF
System backup starts now. You are being logged off.
EOF
wlog "========== END send_wall_msg"
}
################################################################################
stop_database() {
wlog "========== BEGIN stop_database"
cdcachesys
wlog " running: ccontrol stop cache"
ccontrol stop cache quietly
wlog " completed: ccontrol stop cache"
if [ "`ps -ef | awk '/[ \t](cache|openm|msqlm|mux)([ \t]|$)/ {print}'`" ]; then
dbpids=`ps -ef| awk '/[ \t](cache|openm|msqlm|mux)([ \t]|$)/ {print $2}'`
wlog " killing processes: $dbpids"
kill -9 $dbpids
fi
if [ "`ps -ef | awk '/[ \t](cache|openm|msqlm|mux)([ \t]|$)/ {print}'`" ]; then
proccount=`ps -ef | awk '/[ \t](cache|openm|msqlm|mux)([ \t]|$)/ {print}' | wc -l | awk '{ print $1 }'`
wlog " WARNING: some processes remain ($proccount)."
fi
wlog "========== END stop_database"
}
################################################################################
start_database() {
wlog "========== BEGIN start_database"
cdcachesys
wlog " running: ccontrol start cache"
ccontrol start cache
startdbstatus=$?
wlog " sleep 30 seconds"
sleep 30
wlog " stop journaling"
/scripts/tools/stop_journaling
wlog " completed: ccontrol start cache; status=$startdbstatus."
wlog "========== END start_database"
}
################################################################################
split_mirrors() {
wlog "========== BEGIN split_mirrors"
cdhome
vol=/dev/vg03/lvol1
mnt="/defgbdebt"
mnts="/mirror/defgbdebt"
splitit
vol=/dev/vg10/lvol10
mnt="/defgbdebt2"
mnts="/mirror/defgbdebt2"
splitit
vol=/dev/vg04/lvol2
mnt="/def"
mnts="/mirror/def"
splitit
vol=/dev/vg05/lvol1
mnt="/art"
mnts="/mirror/art"
splitit
wlog "========== END split_mirrors"
}
################################################################################
splitit() {
wlog " ========== BEGIN splitit ($mnt; $mnts)"
cdhome
wlog " running: lvsplit -s x $vol"
lvsplit -s x "$vol"
lvsplitstatus=$?
wlog " completed: lvsplit -s x $vol; status=$lvsplitstatus"
if [ $lvsplitstatus != 0 ]; then
wlog " WARNING: lvsplit failed."
fi
wlog " running: fsck -y $vol\x"
fsck -y "$vol"x
fsckstatus=$?
wlog " completed: fsck -y $vol\x; status=$fsckstatus"
if [ $fsckstatus != 0 ]; then
wlog " WARNING: fsck failed"
fi
wlog " running: mount $vol\x $mnts"
mount "$vol"x "$mnts"
mountstatus=$?
wlog " completed: mount $vol\x $mnts; status=$mountstatus"
if [ $mountstatus != 0 ] ; then
wlog " WARNING: $mnts not mounted."
fi
wlog " ========== END splitit ($mnt; $mnts)"
}
################################################################################
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# MAIN BACKUP ROUTINE
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
################################################################################
today=`date +%m_%d_%y`
send_wall_msg;
stop_database;
split_mirrors;
start_database;
cdhome
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 12:16 AM
04-10-2006 12:16 AM
Re: running rsh from windows xp
could you please include a copy of your log messages (wlog) that makes you suspect lvsplit is failing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 12:51 AM
04-10-2006 12:51 AM
Re: running rsh from windows xp
splitit[5]: lvsplit: not found
splitit[13]: fsck: not found
splitit[21]: mount: not found
since these are obviously a *simple* pathing issue, i guess i could hardcode the path in the script unless there's a way to source the running user's profile via windows rsh (something like: ". ./.profile" )
also after closer inspection, the "rsh hpux01 -l root env" shows an environment that does not match the normal (telnet) shell (i.e. under sh, PATH=abc:xyz under rsh, PATH=abc)
thanks,
joel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 12:54 AM
04-10-2006 12:54 AM
Re: running rsh from windows xp
so it seems to be a env problem. Have you tried including your env file into the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 01:17 AM
04-10-2006 01:17 AM
Re: running rsh from windows xp
/usr/sbin/lvsplit
/usr/sbin/mount
to find the binary use "whereis" or "whence"
# whence mount
/usr/sbin/mount
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 02:51 AM
04-10-2006 02:51 AM
Re: running rsh from windows xp
i specified the path to the bin files and everything is OK
i thought of that before and had not yet tried it primarily because the "env" command via rsh indicated that it would see the bin files
regardless - it's fixed