Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Running commands remotely
Results 1 to 6 of 6

Thread: Running commands remotely

Hybrid View

  1. #1

    Running commands remotely

    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.

  2. #2
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re:Running commands remotely

    ssh

    that is the tool for the job.

  3. #3

    Re:Running commands remotely

    Well.. yeah, but I'd rather avoid ssh'ing into 20 boxes, which is kinda the point

  4. #4
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re:Running commands remotely

    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.

  5. #5

    Re:Running commands remotely

    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?


  6. #6
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re:Running commands remotely

    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.

Similar Threads

  1. Remotely connect to LAN
    By gmoreno in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 01-07-2005, 08:08 AM
  2. Putting more commands behind an already running command
    By Uranus in forum Linux - General Topics
    Replies: 4
    Last Post: 11-22-2004, 10:52 AM
  3. running remote command, then leave it running
    By Blaqb0x in forum Linux - General Topics
    Replies: 1
    Last Post: 10-03-2003, 10:36 PM
  4. red Hat version (remotely)
    By elovkoff in forum Linux - General Topics
    Replies: 4
    Last Post: 03-19-2003, 03:12 PM
  5. running apps remotely
    By Blaqb0x in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 02-04-2003, 08:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •