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 another script residing on one location on that server. How can I do this ?

I will be initiating this thing with help of a script say abc.sh residing on the main server.

Pls Help!

Use ssh. Once yo have exchanged the keys yo don't need a password. Read the ssh docmentation to get the concept.

Test the ssh connection by issuing "ssh user@remote_server" - if this asks for a password you have done something wrong.

Now start your script by issuing "ssh user@remote_server command". This will be analoguous to rsh/remsh/rexec.

If you want to minimize any risk you might want to use this to check the connectivity before trying to remotely execute a command:

if [ f_CheckConnectivity remote.server user ] ; then
     ssh user@remote.server command
else
     print - "Error: no authorization at or connection to host remote.server"
fi

I hope this helps.

bakunin

Thanks a lot dude worked like a charm!