summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <rubyfy@dev.buetow.org>2015-10-23 22:25:02 +0100
committerPaul Buetow <rubyfy@dev.buetow.org>2015-10-23 22:25:02 +0100
commit3d7a488e44e8a5913f01d8efa7fb0b1f1d83f17c (patch)
tree64aa847265987818c4d8e3e8d926c7673aead3ec
parent93a0da39be4c8b4864778f1131da9e40fc8d0344 (diff)
add more examples
-rw-r--r--README.md16
1 files changed, 14 insertions, 2 deletions
diff --git a/README.md b/README.md
index 4a32319..b43be49 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,21 @@ Tested on
Example usage:
```
-cat serverlist.txt | ./rubyfy -p 10 -c 'hostname'
+# Run command 'hostname' on server foo.example.com
+./rubyfy -c 'hostname' <<< foo.example.com
-./rubyfy --root --command 'id' <<< foo.example.com
+# Run command 'id' as root (via sudo) on all servers listed in the list file
+# Do it on 10 servers in parallel
+./rubyfy --parallel 10 --root --command 'id' < serverlist.txt
+
+# Run a fancy script in background on 50 servers in parallel
+./rubyfy -p 50 -r -b -c '/usr/local/scripts/fancy.zsh' < serverlist.txt
+
+# Grep for specific process on both servers and write output to ./out/grep.txt
+echo {foo,bar}.example.com | ./rubyfy -p 10 -c 'pgrep -lf httpd' -n grep.txt
+
+# Reboot server only if file /var/run/maintenance.lock does NOT exist!
+./rubyfy --root --command reboot --precondition /var/run/maintenance.lock
```