LinuxQuestions.org
Review your favorite Linux distribution.
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 10-09-2012, 02:55 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 100
Blog Entries: 1

Rep: Reputation: Disabled
How to run shell script on all remote client from server machine simulataneously


Hi all,

I had enabled ssh passwordless login in all my remote client from server .I want to execute a script from my server which simulatneoulsy execute the on all client machine simulataneously.


These the script i want to excute on client machine to find out the tomcat running instant &change password on client macchine

#!/bin/bash

ps uax | grep "tomcat"

echo "newpassword:root passwd" --stdin

Last edited by LittleMaster; 10-09-2012 at 02:59 AM.
 
Old 10-09-2012, 05:42 AM   #2
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
Lightbulb

Code:
!/bin/bash

ssh root@serverX 'ps uax | grep "tomcat" 

if [[ $? -lt 1 ]]
then
echo "newpassword:root passwd" --stdin
else
echo "Failed tomcat search : $(date) " > /home/user/Error.log
fi '

Repeat as needed ........
 
  


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
How to use ssh and run command in the remote machine using shell script salmanmanekia Linux - Newbie 8 04-28-2011 08:41 AM
run a shell script on remote client from a server to find all its running process robin singh Linux - Newbie 7 10-03-2008 12:32 PM
I want to run script on the server from client machine in windows in a perl script vpradeep Linux - Newbie 2 09-01-2008 04:29 AM
Cannot run shell script on the remote server haresh_dba Linux - General 2 04-14-2007 10:26 AM


All times are GMT -5. The time now is 11:05 AM.

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