https://github.com/grycap/runall
https://github.com/grycap/runall
bash bash-scripting server server-management ssh
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/grycap/runall
- Owner: grycap
- License: apache-2.0
- Created: 2018-03-27T11:15:30.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-08T12:15:14.000Z (about 4 years ago)
- Last Synced: 2026-02-12T07:10:06.174Z (4 months ago)
- Topics: bash, bash-scripting, server, server-management, ssh
- Language: Shell
- Size: 41 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# runall
An utility to run a command (or a script) in multiple hosts, using ssh (useful for multiple host management)
## Installation
### From packages
Get the appropriate package and install
**Ubuntu**
```
$ wget https://github.com/grycap/runall/releases/download/1.2-beta0/runall_1.2-beta.0.deb
$ apt update
$ apt install -f ./runall_1.2-beta.0.deb
```
### From sources
Install dependencies
**Ubuntu**
```
$ apt update && apt install -y bash libc-bin coreutils grep uuid-runtime gettext-base openssh-client
```
**CenOS**
```
$ yum update && yum install -y bash coreutils grep gettext openssh-clients
```
Get the code and execute
```
$ git clone https://github.com/dealfonso/runall
$ cd runall
$ ./runall --help
```
## Usage
Examples of use
```
root@ramses:~# runall --summarize --hostlist torito0[1-9] --hostlist torito[10-11] -- hostname
SUMMARY:
hosts:
torito01 torito02 torito03 torito04 torito05 torito06 torito07 torito08 torito09 torito10 torito11
command:
export LANG=C
export LC_ALL=C
hostname
press return to continue (CTRL-C aborts)
torito01
torito02
torito03
torito04
torito05
torito06
torito07
torito08
torito09
torito10
torito11
```
We can make the list of hosts persistent by adding it to the configuration file
```
root@ramses:~# echo "HOSTS=torito0[1-9],torito[10-11]" >> /etc/runall/runall.conf
```
Then you can run commands like the next one:
```
root@ramses:~# runall -X torito0[3-9] -- hostname
torito01
torito02
torito10
torito11
```
Using the flag `-O` the list of hosts in the configuration file will be ignored, and flag `-l` also runs the command in the host (using command `hostname`):
```
root@ramses:~# runall -H torito0[1-2] -O -l -- hostname
torito01
torito02
ramses
```