Accessing one UNIX node from another node of the same server

Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Accessing one UNIX node from another node of the same server
# 1  
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!
# 2  
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.
# 3  
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.
# 4  
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

Code:
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:

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

# 5  
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?

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

# 6  
As this is in the homework forum, please be aware of the special rules that apply here!
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #459
Difficulty: Medium
NTP uses an epoch of January 1, 1970.
True or False?

9 More Discussions You Might Find Interesting

1. Programming

Node-RED: Writing MQTT Messages to MySQL DB with UNIX timestamp

First, I want to thank Neo (LOL) for this post from 2018, Node.js and mysql - ER_ACCESS_DENIED_ERROR I could not get the Node-RED mysql module to work and searched Google until all my links were purple! I kept getting ER_ACCESS_DENIED_ERROR with the right credentials. Nothing on the web was... (0 Replies)
Discussion started by: Neo
0 Replies

2. Infrastructure Monitoring

Using Node-RED and MQTT to Monitor Server and Application Stats

After setting up MQTT and testing some ESP8266 and ESP32 modules, where I noted that testing in Programming ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages, I was so impressed with MQTT that I installed MQTT on three different computers, instantly and... (2 Replies)
Discussion started by: Neo
2 Replies

3. HP-UX

Mount FIle systems from node-1 onto node-2

Hi, We have HP UX service guard cluster on OS 11.23. Recently 40+ LUNs presented to both nodes by SAN team but I was asked to mount them on only one node. I created required VGs/LVs, created VxFS and mounted all of them and they are working fine. Now client requested those FS on 2nd node as... (4 Replies)
Discussion started by: prvnrk
4 Replies

4. Solaris

SVM metaset on 2 node Solaris cluster storage replicated to non-clustered Solaris node

Hi, Is it possible to have a Solaris cluster of 2 nodes at SITE-A using SVM and creating metaset using say 2 LUNs (on SAN). Then replicating these 2 LUNs to remote site SITE-B via storage based replication and then using these LUNs by importing them as a metaset on a server at SITE-B which is... (0 Replies)
Discussion started by: dn2011
0 Replies

5. UNIX for Dummies Questions & Answers

I-node and sessions

I have a program (written by me, for educational purposes) called "analyzer". The program takes a parameter, a filename, and does some statistics on it (for example, word's number, line's number, ... ) at regular intervals. My teacher told me that if the file is edited while the "analyzer" is... (4 Replies)
Discussion started by: hurricane
4 Replies

6. Linux

Accessing node size

Hi, Does the output of the command numactl --hardware available: 1 nodes (0-0) node 0 cpus: 0 1 node 0 size: 8155 MB node 0 free: 3231 MB No distance information available. where, node 0 size: 8155MB mean that the local memory associated with node 0 is 8155MB? Can anyone guide me... (0 Replies)
Discussion started by: heartbreakkid
0 Replies

7. SuSE

Node size

Hi, Does the output of the command numactl --hardware available: 1 nodes (0-0) node 0 cpus: 0 1 node 0 size: 8155 MB node 0 free: 3231 MB No distance information available. where, node 0 size: 8155MB mean that the local memory associated with node 0 is 8155MB? Can anyone guide me... (1 Reply)
Discussion started by: heartbreakkid
1 Replies

8. Red Hat

Node size

Hi, Does the output of the command numactl --hardware available: 1 nodes (0-0) node 0 cpus: 0 1 node 0 size: 8155 MB node 0 free: 3231 MB No distance information available. where, node 0 size: 8155MB mean that the local memory associated with node 0 is 8155MB? Can anyone guide me... (0 Replies)
Discussion started by: heartbreakkid
0 Replies

9. UNIX for Dummies Questions & Answers

Tree directory structure of Unix to get final node path

Hi, I want to list all the last directories from mentioned base path. for eg: If i have a base path say /base/base1/ How can i get the path till last node in tree like directory structure of unix by applying any command. so that i will get following output. ... (7 Replies)
Discussion started by: Shiv@jad
7 Replies

Featured Tech Videos