Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 20th January 2009
bigb89 bigb89 is offline
Fdisk Soldier
Join Date: May 2008
Posts: 69
Default Running a command with input from a file.

Hi guys,

Here's what I'm trying to do:

I have a backup server in my network that has passwordless ssh connection to all the servers in the network. I have a script called "load_checker.sh" that I wanna use to monitor the load on all the servers. Now, I wanna copy load_checker.sh to all of the servers in the network.

I have a list of all of the servers in the network, so to make my job easier, it would be alot faster if I could just run the following command from the backup server:

scp load_checker.sh user@$serverlist:/some/directory/load_checker.sh

The variable $serverlist will be all of the servers that are listed in the serverlist file. That way, load_checker.sh will be sent to every server that's listed on the file. The serverlist file will have each server separated by a line, example:


So as you guys may have noticed, I know the concept what needs to be done, but I just don't know what I have to do.

Conclusion: What would be the best way to scp load_checker.sh to all of the servers that are listed in the serverlist file?

Kind regards,
Reply With Quote

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input foreign characters under X11 Beastie General software and network 5 30th August 2009 11:51 AM
Command to find and replace, but not creating a new file 18Googol2 Programming 4 22nd September 2008 10:28 PM
how to enable file/command completion for ksh93? TerryP General software and network 1 31st August 2008 08:23 AM
C and file input/output 18Googol2 Programming 3 20th August 2008 04:02 PM
shell script with input c0mrade Programming 5 13th July 2008 04:33 AM

All times are GMT. The time now is 09:02 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick