Updated sync scripts to simplify usage. Added scripts for das2
authorGeorge Milescu <george.milescu@gmail.com>
Thu, 26 Aug 2010 11:34:25 +0000 (13:34 +0200)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 20 Sep 2010 16:02:40 +0000 (18:02 +0200)
Signed-off-by: George Milescu <george.milescu@gmail.com>
Utils/cssh_das2.sh [new file with mode: 0755]
Utils/sync_cluster.sh
Utils/sync_cluster_containers.sh
Utils/sync_das2.sh [new file with mode: 0755]
Utils/sync_single_cluster.sh [deleted file]
Utils/sync_single_cluster_container.sh [deleted file]

diff --git a/Utils/cssh_das2.sh b/Utils/cssh_das2.sh
new file mode 100755 (executable)
index 0000000..d521a65
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright: George Milescu 2010 - george.milescu@gmail.com
+#
+# Bash script used to connect to the machines on DAS-2
+# The script
+#  * starts a cssh session
+#  * sets the size of the windows to 78x19
+#
+# Script arguments:
+#  * remote user
+
+if [ ! $# -eq 1 ]; then
+       echo "usage: $0 user"
+       exit 1
+fi
+
+REMOTE_USER=$1
+
+cssh --term-args "-geometry 78x19" $REMOTE_USER@node300 $REMOTE_USER@node301 $REMOTE_USER@node302 $REMOTE_USER@node303 $REMOTE_USER@node304 $REMOTE_USER@node306 $REMOTE_USER@node308 $REMOTE_USER@node309 $REMOTE_USER@node311 $REMOTE_USER@node312 $REMOTE_USER@node313 $REMOTE_USER@node314 $REMOTE_USER@node315
index 1ac756d..143f754 100755 (executable)
@@ -2,6 +2,7 @@
 #
 # Copyright: George Milescu 2010 - george.milescu@gmail.com
 #
+# The script can be used with one parameter or with no parameters
 
 # Read the global configuration file
 # Check if the global configuration file exists
@@ -11,6 +12,26 @@ else
        source ../ControlScripts/globalconfig
 fi
 
-for host in p2p-next-01.grid.pub.ro p2p-next-03.grid.pub.ro p2p-next-04.grid.pub.ro p2p-next-05.grid.pub.ro p2p-next-06.grid.pub.ro p2p-next-07.grid.pub.ro p2p-next-08.grid.pub.ro p2p-next-09.grid.pub.ro p2p-next-10.grid.pub.ro; do
-       ./sync_single_cluster.sh $host
-done
+if [ $# -gt 1 ]; then
+       echo "Usage:"
+       echo "* to synchronize one remote system: $0 remote-system"
+       echo "* to synchronize all cluster systems: $0"
+       exit 1
+fi
+
+sync_cluster_host() {
+       remote_system=$1
+       echo "Syncing $remote_system"
+       rsync -avP --del $P2P_NEXT_REL_PATH/P2P-Testing-Infrastructure p2p@${remote_system}:/home/p2p/george/P2P-Next/
+}
+
+if [ $# -eq 0 ]; then
+       for host in p2p-next-01.grid.pub.ro p2p-next-03.grid.pub.ro p2p-next-04.grid.pub.ro p2p-next-05.grid.pub.ro p2p-next-06.grid.pub.ro p2p-next-07.grid.pub.ro p2p-next-08.grid.pub.ro p2p-next-09.grid.pub.ro p2p-next-10.grid.pub.ro; do
+               sync_cluster_host $host
+       done
+else
+       sync_cluster_host $1
+fi
+
+
+
index 981fc6f..249c3b7 100755 (executable)
@@ -2,6 +2,7 @@
 #
 # Copyright: George Milescu 2010 - george.milescu@gmail.com
 #
+# The script can be used with two parameters or with no parameters
 
 # Read the global configuration file
 # Check if the global configuration file exists
@@ -11,8 +12,26 @@ else
        source ../ControlScripts/globalconfig
 fi
 
-for host in p2p-next-01.grid.pub.ro p2p-next-03.grid.pub.ro p2p-next-04.grid.pub.ro p2p-next-05.grid.pub.ro p2p-next-06.grid.pub.ro p2p-next-07.grid.pub.ro p2p-next-08.grid.pub.ro p2p-next-09.grid.pub.ro p2p-next-10.grid.pub.ro; do
-       for port in 10122 10222 10322 10422 10522 10622 10722 10822 10922 11022; do
-               ./sync_single_cluster_container.sh $host $port
+sync_cluster_container() {
+       host=$1
+       port=$2
+       echo "Syncing $host $port"
+       rsync -avP --del --rsh='ssh -p'$port $P2P_NEXT_REL_PATH/P2P-Testing-Infrastructure p2p@$host:/home/p2p/george/ > /dev/null
+}
+
+if [ $# -gt 1 ]; then
+       echo "Usage:"
+       echo "* to synchronize one remote system: $0 remote-system remote-port"
+       echo "* to synchronize all cluster containers: $0"
+       exit 1
+fi
+
+if [ $# -eq 0 ]; then
+       for host in p2p-next-01.grid.pub.ro p2p-next-03.grid.pub.ro p2p-next-04.grid.pub.ro p2p-next-05.grid.pub.ro p2p-next-06.grid.pub.ro p2p-next-07.grid.pub.ro p2p-next-08.grid.pub.ro p2p-next-09.grid.pub.ro p2p-next-10.grid.pub.ro; do
+               for port in 10122 10222 10322 10422 10522 10622 10722 10822 10922 11022; do
+                       sync_cluster_container $host $port
+               done
        done
-done
+else
+       sync_cluster_container $host $port
+fi
\ No newline at end of file
diff --git a/Utils/sync_das2.sh b/Utils/sync_das2.sh
new file mode 100755 (executable)
index 0000000..a873527
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# Copyright: George Milescu 2010 - george.milescu@gmail.com
+#
+# The script can be used with one parameter or with no parameters
+
+# Read the global configuration file
+# Check if the global configuration file exists
+if [ ! -e ../ControlScripts/globalconfig ]; then
+       echo "Warning: The global config file ../ControlScripts/globalconfig does not exist."
+else
+       source ../ControlScripts/globalconfig
+fi
+
+sync_das2_host() {
+       remote_system=$1
+       echo "Syncing $remote_system"
+       rsync -avP --del $P2P_NEXT_REL_PATH gmilescu@${remote_system}:/home/gmilescu/P2P-Next
+}
+
+if [ $# -gt 1 ]; then
+       echo "Usage:"
+       echo "* to synchronize one remote system: $0 remote-system"
+       echo "* to synchronize all cluster systems: $0"
+       exit 1
+fi
+
+if [ $# -eq 0 ]; then
+       for host in node300 node301 node302 node303 node304 node306 node308 node309 node311 node312 node313 node314 node315; do
+               sync_das2_host $host
+       done
+else
+       sync_das2_host $1
+fi
\ No newline at end of file
diff --git a/Utils/sync_single_cluster.sh b/Utils/sync_single_cluster.sh
deleted file mode 100755 (executable)
index 77c7944..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# Copyright: George Milescu 2010 - george.milescu@gmail.com
-#
-# 2010, Razvan Deaconescu, razvan.deaconescu@cs.pub.ro
-
-if test $# -ne 1; then
-       echo "Usage: $0 remote-system" 1>&2
-       exit 1
-fi
-
-# Read the global configuration file
-# Check if the global configuration file exists
-if [ ! -e ../ControlScripts/globalconfig ]; then
-       echo "Warning: The global config file ../ControlScripts/globalconfig does not exist."
-else
-       source ../ControlScripts/globalconfig
-fi
-
-remote_system=$1
-
-rsync -avP --del $P2P_NEXT_REL_PATH/P2P-Testing-Infrastructure p2p@${remote_system}:/home/p2p/george/P2P-Next/
diff --git a/Utils/sync_single_cluster_container.sh b/Utils/sync_single_cluster_container.sh
deleted file mode 100755 (executable)
index 4d5f68f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-#
-# Copyright: George Milescu 2010 - george.milescu@gmail.com
-#
-
-if test $# -ne 2; then
-       echo "Usage: $0 host port" 1>&2
-       exit 1
-fi
-
-# Read the global configuration file
-# Check if the global configuration file exists
-if [ ! -e ../ControlScripts/globalconfig ]; then
-       echo "Warning: The global config file ../ControlScripts/globalconfig does not exist."
-else
-       source ../ControlScripts/globalconfig
-fi
-
-host=$1
-port=$2
-
-echo "Syncing $host $port"
-rsync -avP --del --rsh='ssh -p'$port $P2P_NEXT_REL_PATH/P2P-Testing-Infrastructure p2p@$host:/home/p2p/george/ > /dev/null