LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trigger a script and logon to the next server without waiting for result (https://www.linuxquestions.org/questions/linux-newbie-8/trigger-a-script-and-logon-to-the-next-server-without-waiting-for-result-931879/)

lakshminarayanan 02-29-2012 01:09 AM

trigger a script and logon to the next server without waiting for result
 
Hi All,

I have a script in some 20 servers. I want it to be executed at the same time on all the servers but my CI owner wouldn't allow me to add it to the crontab.
Can some body suggest me a way to trigger the script through a for loop?.

I wrote a for loop
[for i in (seq -w 01 20); do ssh atrs$i sh /orauser/squeeze.sh; done]

But this waits until the execution is completed in one server before logging into the next. Instead I want it to trigger the script,let it run in the background, exit and logon to the next.
I am not sure how to use nohup here, if that is a solution.

Note:- I am connected to the servers through putty

Many thanks in advance

EricTRA 02-29-2012 01:27 AM

Hi,

I'm not sure how you would do that using Putty alone but if I'm not mistaking Putty Connection Manager, as reference here has that option. If not you could have a look at Putty Command Sender. As with everything have a look at Google first, that's how I found, as Linux user, a possible answer to your question.

Also, I'm reporting this thread to be moved to General since it's not Linux related in my opinion. You're looking for a way to execute the same command on several Putty sessions at once which would be pretty easy using Linux.

-- EDIT --

I'm sorry, I think I misunderstood you completely. Can you confirm that you have a Putty session from your Windows machine to a Linux server and are running that script/command(s) from that server? I assume since you're running over SSH that the server in question has no graphical environment, correct? If so, have a look at clusterssh, it should be available in your repository.

Kind regards,

Eric

lakshminarayanan 02-29-2012 01:54 AM

Hi Eric,

You are right. I am connected to the Linux servers through putty from my windows machine over SSH.

EricTRA 02-29-2012 02:04 AM

Quote:

Originally Posted by lakshminarayanan (Post 4614790)
Hi Eric,

You are right. I am connected to the Linux servers through putty from my windows machine over SSH.

Hi,

OK, sorry for the misunderstanding. As indicated, have a look at clusterssh, I think it's exactly what you need if you want to send a command simultaneously to multiple servers.

@moderation team: How do I 'unreport' a post?

Kind regards,

Eric

colucix 02-29-2012 02:31 AM

Quote:

Originally Posted by EricTRA (Post 4614797)
@moderation team: How do I 'unreport' a post?

Hi Eric! :) Just report it again! ;) Or contact a moderator of the forum via PM or e-mail. I'm going to mark the report as solved, right now. Cheers!

EricTRA 02-29-2012 03:42 AM

Quote:

Originally Posted by colucix (Post 4614808)
Hi Eric! :) Just report it again! ;) Or contact a moderator of the forum via PM or e-mail. I'm going to mark the report as solved, right now. Cheers!

Hi,

Thanks Alex and sorry for the trouble.

Kind regards,

Eric


All times are GMT -5. The time now is 07:40 PM.