remote server command in a job


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remote server command in a job
# 1  
Old 01-30-2002
remote server command in a job

I need a cron job to shut services running on other nodes, do some db maintenance, then restart the remote services. This is HP-UX 11.00.

I cannot get remsh to work, even interactively. Per man page, does not prompt for password. I get:

remsh appserver -l oracle stop_services
remshd: Login incorrect.

If I don't specify the stop_services command, then remsh runs rlogin (as per the man page), which works, but is not what I want. I have tried using rlogin in a job, but no luck there either - seems I can't redirect stdin.

rexec appserver -l oracle stop_services

I get further with rexec. The above works interactively, and it prompts for password. I have tried various ways to feed the password in a job.
Jimbo
# 2  
Old 01-30-2002
Are there security concerns? If not, double check your info for rsh, rlogin, .rhosts, or /etc/hosts.equiv. You may be missing a simple ingredient to get these commands to work.

If you can't get any of the remote command to work, you could try setting up a cron job on each remote system that waits for a specific file to be ftp'd over - along with a loop, sleep, and if statement which would allow it to stop trying after a specified time.

Or you could check into cfengine - not sure it would do exactly what you want. http://www.iu.hio.no/cfengine/
Just realize that it will make the changes you want and is as unforgiving as other UNIX commands.
thehoghunter
# 3  
Old 01-30-2002
That did it hoghunter. I created .rhosts and now remsh works great.

And by the way, if I could not get this to work, I had already planned to do just what you suggested - a sleeper job on the remote servers waiting for a file to be ftp'ed over. But it could not be cron since this is an on-demand job, so I'm happy to get this working - launch a single job to do it all.

Thanks!

Last edited by Jimbo; 01-30-2002 at 03:26 PM..
Jimbo
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. UNIX for Beginners Questions & Answers

How to run command on remote server?

Hi I am trying to write a script which when I run from server A it execute few command on another server say B and show me the output. below is the script but it is not showing me the o/p of B machine but instead showing me A machine o/p every time. #!/bin/bash for i in `cat... (14 Replies)
Discussion started by: scriptor
14 Replies

3. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

4. Shell Programming and Scripting

Running nohup command on remote server

I am having an issue in running a nohup command in a remote linux box from a linux box. Here are the details. Linux Machine 1: I have a script which starts a services and dumps the output into a log file. nohup sh weblogic.sh >> /home/log.out & I have placed the entire command in a... (2 Replies)
Discussion started by: accessbalaji
2 Replies

5. AIX

Script to start a remote batch job on another server

Hi , I am trying to execute one script residing on server B from server A and in automated way but with a trigger. My main quetion are 1) How I will login to the remote server automatically with user name and password. ( rsh or any other way ?) 2) Once logged in I need to execute... (2 Replies)
Discussion started by: agent47
2 Replies

6. UNIX for Dummies Questions & Answers

Executing ls command in remote server

Hi Guru, I have a requirement where i need to list the *.csv files in my remote server and copy a file from that server to my unix server I wrote dis code #!/bin/sh . /home/aaa/bb/GlobalHost.sh export HOST export USER export PWD ftp -n $HOST <<END_SCRIPT quote USER $USER quote... (1 Reply)
Discussion started by: pssandeep
1 Replies

7. Shell Programming and Scripting

ls command in Remote Server

Unix Box: IBM AIX Shell : K-Shell When i logged into a remote server through FTP, and tried to find only required month file by typing `ls -ltr *200805`, the output is "ls remotefile localfile". I coudnt understand this. What is want is get into the remote server and get the count of required... (6 Replies)
Discussion started by: vasuarjula
6 Replies

8. Solaris

Running command on Remote server

Hi, I have username/password for a remote server. I would like to have list of filenames and their size in a particular directory of remote server. Now Problem is - I can not use rsh command as I can not modify rhost file of remote server. Thanks in advance. Sanjay (1 Reply)
Discussion started by: sanjay1979
1 Replies

9. Shell Programming and Scripting

ls -ltr command On Remote server

I am writing a script where in i have to log into a remote machine and check for necessary file by typing (ls -ltr *200505) (this gets all 05month of 2008 yr files) and if files are found get them to the local machine. If not found print a message saying no files on local machine. When i was... (2 Replies)
Discussion started by: vasuarjula
2 Replies

10. AIX

ls command in Remote Server

Unix Box: IBM AIX Shell : K-Shell When i logged into a remote server through FTP, and tried to find only required month file by typing `ls -ltr *200805`, the output is "ls remotefile localfile". I coudnt understand this. What is want is get into the remote server and get the count of required... (0 Replies)
Discussion started by: vasuarjula
0 Replies
Login or Register to Ask a Question