Skip to main content
5 events
when toggle format what by license comment
Sep 6, 2018 at 10:45 comment added Foad Ok, I think if we replace sinfo -h with ssh foo "sinfo -h;" the problem is mostly solve the only issue is that the -u flag for sort doesn't work and leads to the The system cannot find the file specified. error.
Sep 6, 2018 at 9:12 comment added Foad If i want to run the bash on one of the nodes then I have to put my private key there, which can be read by everyone else. What I want is to run the script from my own computer(s). Is there any way to pip the output of a command ran on the server to the local machine?
Sep 6, 2018 at 7:38 comment added Nico Mittenzwey You can put the code in a file "checkAllServers.sh" in your home on the server and run it from your machine via ssh foo bash checkAllServers.h or you can run the whole code in one line via: ssh foo 'for hostList in $(sinfo -h | awk '{print $6}' | sort -u); do for host in $(scontrol show hostname $hostList); do echo $host; ssh $host "ps aux | grep user1"; done; done;'
Sep 5, 2018 at 11:46 comment added Foad thanks a lot. I'm trying to go through the code step by step. The first issue is that to get the sinfo you need to first ssh into one of the servers, lets say foo
Sep 5, 2018 at 10:42 history answered Nico Mittenzwey CC BY-SA 4.0