Accessing one UNIX node from another node of the same server

Hi Experts,

I am in need of running a script from one node say node 1 via node 2.

My scheduling tool dont have access to node2 , so i need to invoke the list file from node1 but the script needs to run from node2. because the server to which i am hitting, is having access only for the node 2.

Please help me how to acheive this for running a script via a node 2 from node 1.

Thank you!

Not clear. What role does the "server to which you are hitting" play? Use e.g. ssh from node 1 to run a script on node 2.

Hi,
What i understood from your question : you want to list the file on node 1, but you want to trigger it from node 2 because you don't have scheduling tool in node 1.
In this case we need to write a script on node 1(this scirpt will wait for a signal from node 1).

1> Set the crontab in node 2(where you have access to crontab, if you don't have access to crontab you can write a script to send email to node 1 ) to send an email to node 1.
2> Write a script in node 1 to check for a new email, if new email is available in node 1, execute the command (whatever you want to execute).
If you need help with script, let me know.

well lets say you can't use cron for whatever reason. maybe your not in the cron.allowed list. I'd hope you can use ssh.

I use the command

ssh -tt 

to run commands on remote host

if you have a list of commands in a file to be executed you could do something like this:

while read line
do
ssh -tt $line 
done < <file> 

First, that will break because ssh will read from standard input and 'eat' the entire file the first loop. You need ssh -n to prevent it reading from standard input.

Oddly, it may end up working anyway, because after 'eating' the file, it would try and run the commands given in it, that being why it reads from standard input.

So: Why bother ssh-ing 99 times to run 99 commands? Why not use that feature?

Also: Why -t?

ssh username@host exec /bin/sh -s  < list-of-commands

As this is in the homework forum, please be aware of the special rules that apply here!