ssh
that is the tool for the job.
I'm not sure if the title of the thread captures what I'm trying to do, but here goes anyway:
I have a script to flush a file that I need to run on ~20 linux boxes. What I'd like to be able to do is have a single script that I run from a central machine that can execute the flush script on each of the servers.
It can't be done as a cron job, and it's in response to an alert I receive. The script itself won't reside on any of the servers ideally, as I'd like to be able to change it on the fly in response to the alert.
I'm absolutely certain that this is a simple thing to do and I'm just being a tard
I'd be very grateful if anyone could help.
ssh
that is the tool for the job.
Well.. yeah, but I'd rather avoid ssh'ing into 20 boxes, which is kinda the point
you can just execute a command with ssh.
the other way to do it is to setup a shared folder that holds a script that can be executed from cron. that way any changes can be propogated to all without much effort.
You mean
#/bin/bash
ssh some.box some -command
ssh some.other.box some -command
ssh yet.another.box some -command
in a script type thing?
Well the original post yeah, thats what I figured. Although I would do several scripts for simplicity.
For example to upgrade all 20 boxes I would have a script that essentially just iterates thru each box, running the actual script that updates or whatnot that box.
i.e:
if we have beer01.beer.com - beer20.beer.com, we can make a script that will iterate thru each server and update it.
for i in [1..20] do
update beer$i.beer.com
and then the script update would have all of the commands.
The other idea is to only make the update script, save it in a nfs/afs/smb share and have each box run it via cron.
Bookmarks