trigger a script and logon to the next server without waiting for result
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.