LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-29-2012, 01:09 AM   #1
lakshminarayanan
LQ Newbie
 
Registered: Jan 2010
Posts: 9

Rep: Reputation: 2
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
 
Old 02-29-2012, 01:27 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
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

Last edited by EricTRA; 02-29-2012 at 01:31 AM.
 
Old 02-29-2012, 01:54 AM   #3
lakshminarayanan
LQ Newbie
 
Registered: Jan 2010
Posts: 9

Original Poster
Rep: Reputation: 2
Hi Eric,

You are right. I am connected to the Linux servers through putty from my windows machine over SSH.
 
Old 02-29-2012, 02:04 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by lakshminarayanan View Post
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
 
Old 02-29-2012, 02:31 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by EricTRA View Post
@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!

Last edited by colucix; 02-29-2012 at 02:32 AM.
 
Old 02-29-2012, 03:42 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by colucix View 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!
Hi,

Thanks Alex and sorry for the trouble.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trigger jenkins build with URL trigger when using git? jonizen Linux - Server 1 10-14-2011 01:07 PM
Appeared for RHCE exam today, waiting for result. naman.jandial General 6 05-17-2010 11:57 PM
WinXP pro don't run "logon script = logon.bat" Bengt7jqb Linux - Server 2 04-13-2008 12:11 PM
My browser, all day today: 'waiting for linuxquestions.org...' ..waiting.. waiting .. GrapefruiTgirl LQ Suggestions & Feedback 18 05-25-2007 05:35 AM
How do I trigger ctrl+z via a script? closet geek Linux - General 1 05-31-2005 06:53 PM


All times are GMT -5. The time now is 05:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration