From bf8cdbee451d7cc1650a7d0a1fa8e8200a459849 Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Tue, 11 Jul 2017 14:02:25 -0400 Subject: [PATCH] pssh: add page (#1422) --- pages/common/pssh.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pages/common/pssh.md diff --git a/pages/common/pssh.md b/pages/common/pssh.md new file mode 100644 index 000000000..b34797f02 --- /dev/null +++ b/pages/common/pssh.md @@ -0,0 +1,27 @@ +# pssh + +> Parallel ssh program. + +- Run a command on host1 and host2 to print the date on each server inline: + +`pssh -i -H "{{host1}} {{host2}}" {{date}}` + +- Run a command and save the output to separate files: + +`pssh -H {{host1}} -H {{host2}} -o {{path/to/output_dir}} {{date}}` + +- Run a command on each host specified in a new-line separated host file: + +`pssh -i -h {{path/to/hosts_file}} {{date}}` + +- Run a command as root; asks for root password: + +`pssh -i -h {{path/to/hosts_file}} -A -l {{root}} {{date}}` + +- Run a command with extra SSH arguments: + +`pssh -i -h {{path/to/hosts_file}} -x "{{-O VisualHostKey=yes}}" {{date}}` + +- Run a command using a maximum number of concurrent connections: + +`pssh -i -h {{path/to/hosts_file}} -p {{10}} '{{cd dir; ./script.sh; exit}}'`