Utils: add sync_single_cluster.sh script; update sync_cluster.sh script to call sync_...
authorP2P-Next <p2p@p2p-next-04.grid.pub.ro>
Wed, 18 Aug 2010 13:48:49 +0000 (16:48 +0300)
committerP2P-Next <p2p@p2p-next-04.grid.pub.ro>
Wed, 18 Aug 2010 13:48:49 +0000 (16:48 +0300)
Utils/sync_cluster.sh
Utils/sync_single_cluster.sh [new file with mode: 0755]

index 2af39f6..1ac756d 100755 (executable)
@@ -11,13 +11,6 @@ else
        source ../ControlScripts/globalconfig
 fi
 
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-01.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-03.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-04.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-05.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-06.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-07.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-08.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-09.grid.pub.ro:/home/p2p/george/P2P-Next
-rsync -avP --del $P2P_NEXT_REL_PATH p2p@p2p-next-10.grid.pub.ro:/home/p2p/george/P2P-Next
-
+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
diff --git a/Utils/sync_single_cluster.sh b/Utils/sync_single_cluster.sh
new file mode 100755 (executable)
index 0000000..77c7944
--- /dev/null
@@ -0,0 +1,22 @@
+#!/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/