-
Notifications
You must be signed in to change notification settings - Fork 11
/
pussh.1
106 lines (97 loc) · 3.34 KB
/
pussh.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.\" Yes, this man page is handcrafted.
.TH TR "1" "Apr 2024" "pussh" "User Commands"
.SH NAME
pussh \- parallel ssh, run a shell snippet or a whole program quickly on many hosts
.SH SYNOPSIS
.B pussh
[\fIOPTION\fR]... \fICOMMAND \fR[\fIARGS\fR]...
.SH DESCRIPTION
.PP
pussh takes a host list and a shell snippet or a whole program, then run it in
batch mode on all hosts and return their output. It adds facilities to pipe
file or commands to every command's input and/or output. It is meant to be a
natural extension to the SSH batch mode (eg.: in | sh "command args ..." |
out), although having many inputs and outputs does not let you use pipes the
same way; you will have to decide how to multiplex those inputs and outputs,
which should hopefully be easy.
.SH OPTIONS
.TP
\fB-f\fR, \fB--from-file\fR FILE
connect to hosts listed in FILE, one per line. Special file '-' may be used
for stdin. Empty lines or lines starting with a dash (#) are ignored.
.TP
\fB-h\fR, \fB--hosts\fR HOST,...
connect to thosse hosts. Several -h options may be used. Every host can be
specified as [login@]host[:port].
.TP
\fB-i\fR, \fB--input\fR INPUT
feed a file (%h to split by host, -i in/%h.txt) or a command to remote stdin
(-i 'tar -czC in/%h|')
.TP
\fB-l\fR, \fB--login\fR USER
remote login name; shortcut for -s '-l USER'
.TP
\fB-n\fR, \fB--dry-run\fR
dry run: don't run commands, only print what would be done
.TP
\fB-o\fR, \fB--output\fR OUTPUT
output to a file (%h to split by host, -o out/%h.txt), or to a command
(-o '|tar -xzC out/%h')
.TP
\fB-q\fR, \fB--quiet\fR
quiet: don't stamp (prefix) stdout and stderr, do not report total hosts and
time
.TP
\fB-r\fR, \fB--rate\fR RATE
connect rate in new SSH connections/sec (default: 10)
.TP
\fB-s\fR, \fB--ssh-opt\fR OPTIONS
pass OPTIONS to SSH, eg. -s '-x -p 2022'
.TP
\fB-u\fR, \fB--upload\fR
upload the command file and run its copy remotely
.TP
\fB--help\fR
display this help and exit
.TP
\fB--version\fR
output version information and exit
.PP
You may use the SSH syntax \fBlogin@host\fR for HOST within \fB--from-file\fR and \fB--hosts\fR options to specify a different login for each host. This will override the \fB--login\fR option if given.
.SH EXAMPLES
.PP
Show all servers rootfs usage in descending order :
.IP
pussh -f servers df -h / |grep /dev |sort -rn -k5
.PP
Count the number of processors in a cluster :
.IP
pussh -f servers grep ^processor /proc/cpuinfo |wc -l
.PP
Show the processor models, sorted by occurrence :
.IP
pussh -f servers sed -ne "s/^model name.*: //p" /proc/cpuinfo |sort |uniq -c
.PP
Fetch a list of installed package in one file per host :
.IP
pussh -f servers -o packages-for-%h dpkg --get-selections
.PP
Mass copy a file tree (broadcast) :
.IP
tar czf files.tar.gz ... && pussh -f servers -i files.tar.gz tar -xzC /to/dest
.PP
Mass copy several remote file trees (gather) :
.IP
pussh -f servers -o '|(mkdir -p %h && tar -xzC %h)' tar -czC /src/path .
.SH AUTHOR
Written by Vincent Caron <[email protected]>.
.SH "REPORTING BUGS"
Report pussh bugs via https://github.com/bearstech/pussh/issues
.SH COPYRIGHT
Copyright \(co 2011-2024 Bearstech
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
The project home page at https://github.com/bearstech/pussh