- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help me: How to execute script in a remote ho...
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
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
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
08-29-2006 03:48 PM
08-29-2006 03:48 PM
I am really stuck with this case:
I have three servers (HP-UX 11.i): ServerA, ServerB and ServerC
I have username "opr1" in all servers and I can login each other with rlogin.
Now, from serverA (with "opr1" user)I want to make a script that copy a file from serverC to ServerA and then update that file. After that, copy that file from ServerA to ServerB and then execute a script to update this file again.
The script like:
# Copy a file "file_name" from ServerC to ServerA
rcp -p ServerC:/apps/file_name /apps/
{
Update "file_name"......
..........
..........
}
# Copy file "file_name" from ServerA to ServerB
??????
??????
# Execute a script to update this file in ServerB
?????
?????
Please help me!
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2006 04:36 PM
08-29-2006 04:36 PM
Re: Help me: How to execute script in a remote host
Update you /etc/hosts.equiv, and .rhosts files which will enable you to remote login and remote copy.
Then remote copy the file using rcp
change the directory to where you want to copy
rcp â p hostname:/path/filename .
edit the file
then copy back to the other server
rcp filename hostname:/path/
IA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2006 05:57 PM
08-29-2006 05:57 PM
Re: Help me: How to execute script in a remote host
First of all, you have to provide rcp and remsh execution without a password request by editing ~opr/.rhosts on serverB and serverC (add ServerA hostname into the file).
Let's suppose that the script which updates the file called /apps/update.sh
#Copy a file "file_name" from ServerC to ServerA
rcp -p ServerC:/apps/file_name /apps/
#Update "file_name"
/apps/update.sh
# Copy file "file_name" from ServerA to ServerB
rcp -p /apps/file_name serverB:/apps/.
# Execute a script to update this file in ServerB
remsh serverB /apps/update.sh
Best
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2006 08:46 PM
08-29-2006 08:46 PM
Re: Help me: How to execute script in a remote host
implementation using ssh would be much simpler.
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2006 09:41 PM
08-29-2006 09:41 PM
Re: Help me: How to execute script in a remote host
Now I want to execute a script in ServerB from ServerA.
I can use
<>remsh ServerB ls
But I can not execute a script in ServerB from ServerA:
<>remsh ServerB /tmp/myscript.sh
The screen out put:
ksh: /tmp/myscript.sh: not found
Has any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2006 11:21 PM
08-29-2006 11:21 PM
Re: Help me: How to execute script in a remote host
The script you to execute need to be in the server, that will be executed.
Put /tmp/myscript.sh in the ServerB, check that have permissions to execute. If you can to that command without asking for password the schema it's the correct:
# rmsh ServerB date
or
# rmsh ServerB -l user date
Good luck,
Joel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2006 12:15 AM
08-30-2006 12:15 AM
Re: Help me: How to execute script in a remote host
you have to put the script first to this serverB:
<>rcp /apps/file_name ServerB:/tmp/myscript
Note, that there my be no execution bit set on this script, so better call the shell directly:
<>remsh ServerB sh /tmp/myscript.sh
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2006 12:36 PM
08-30-2006 12:36 PM
Re: Help me: How to execute script in a remote host
But there are some command (application command) in the script doens't work :-(
It said: not found???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2006 01:02 PM
08-30-2006 01:02 PM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2006 01:12 PM
08-30-2006 01:12 PM
Re: Help me: How to execute script in a remote host
I will set now...
Thanks A. Clay Stephenson.
Have a nice weekend :)