Add the source files for the swift library.
[swifty.git] / src / libswift / mfold / do-harvest.sh
diff --git a/src/libswift/mfold/do-harvest.sh b/src/libswift/mfold/do-harvest.sh
new file mode 100644 (file)
index 0000000..7060705
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+# This script executes a chain of commands
+# on all the member servers, in parallel.
+# Commands are defined in .sh files (see
+# docmd.sh); all failed executions are
+# put to the FAILURES file
+rm -f FAILURES
+
+if [ -z "$SERVERS" ]; then
+    SERVERS="das2.txt"
+fi
+HOSTS=`cat $SERVERS | awk '{print $1}'`
+
+for srv in $HOSTS; do
+    ( for cmd in $@; do
+        if ! ./docmd.sh $srv $cmd; then
+            echo $srv >> FAILURES
+            echo $src FAILED
+            break
+        fi
+    done ) &
+done
+
+wait
+echo DONE