- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- remsh vs. rlogin
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-22-2005 03:13 AM
04-22-2005 03:13 AM
I am writing a script to copy a database between two servers. Basically, shut down the database on both servers, copy, then restart both. To do this, I need to run commands locally on both machines.
Initially, I was trying to use rlogin in a script, issue 4-5 commands on the remote system, exit the remote system, then continue with the rest of the script.
I was having trouble, so I think remsh will work, but I have to issue a separate remsh line for each work item, correct?
Is the best way to do this?
Below is a sample of what I was trying to do:
rlogin system2
./shut.reports
./start.reports
exit
Is this preferred/better?:
remsh system2 /scripts/shut.reports
remsh system2 /scripts/start.reports
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 03:17 AM
04-22-2005 03:17 AM
Solutionremsh system2 -n /scripts/shut.reports
Though, for security reasons, you should probably take a look at secure shell:
http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 03:20 AM
04-22-2005 03:20 AM
Re: remsh vs. rlogin
do include the double quotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2005 04:11 PM
04-23-2005 04:11 PM
Re: remsh vs. rlogin
Yes , the second option seems to be a better option especially when you do it through script.
This is what we also use.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2005 01:30 AM
04-24-2005 01:30 AM
Re: remsh vs. rlogin
... myhost# remsh remhost hostname \; pwd \; id \; cd /tmp \; pwd
Or, you can simply quote the entire command list:
... myhost# remsh remhost 'hostname ; pwd ; id ; cd /tmp ; pwd'
You could, therefore, run your scripts with one 'remsh' thusly:
... myhost# remsh system2 /scripts/shut.reports \; /scripts/start.reports
I do things like that quite often for stopping/restarting remote services.
**However**, be aware that your environment will not be set completely when doing a 'remsh' (it is not an interactive login and .profile, etc., are not sourced). This includes PATH, which will be set to a minimal value. You can see this clearly from the following command:
... myhost# echo $PATH ; remsh remhost echo \$PATH
Be sure to escape the 2nd $ in the above; otherwise, $PATH will be evaluated locally, *before* being passed to 'remsh' !
You will see that the PATH returned from the remote execution is minimal.
Here's an example technique that I use very often to get around this between similar systems:
... myhost# remsh remhost PATH=$PATH \; cust-command
where cust-command would be in some location that would not be in the normal minimal $PATH. Notice, here, the *lack* of single quotes around $PATH. This means that it will be evaluated locally before being passed to 'remsh' and then PATH will be set the same as on the local system as part of the remote command.
If your scripts are written to use absolute pathnames or to set $PATH appropriately (which sub-system start/stop scripts usually are), then this is not a concern.
You can extend this to other vars as well:
... myhost# remsh remhost PATH=$PATH \; export V1=foo \; cust-command
Or, just source a non-interactive file that sets the required vars, including PATH:
... myhost# remsh system2 . /scripts/.setVars \; /scripts/shut.reports \; /scripts/start.reports
(notice the " . " before /scripts/.setVars)
HTH
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2005 03:12 PM
04-24-2005 03:12 PM
Re: remsh vs. rlogin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2005 10:53 PM
04-24-2005 10:53 PM