Index: trunk/tools/eam/rebalance/launch.insert.check.errors.sh
===================================================================
--- trunk/tools/eam/rebalance/launch.insert.check.errors.sh	(revision 42314)
+++ trunk/tools/eam/rebalance/launch.insert.check.errors.sh	(revision 42534)
@@ -1,76 +1,62 @@
 #!/bin/csh 
 
-set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+set program = `basename $0`
 
-set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+set run = v0
+set version = 20230802
+set mode = insert
 
-if ($#argv == 1) then
-  if ("$1" != "launch") then
-    echo "USAGE: launch.insert.check.errors.sh launch"
-    exit 2
-  endif
-  foreach f ($list)
-    echo ssh -f $f "cd $mydir && ./launch.insert.check.errors.sh"
-         ssh -f $f "cd $mydir && ./launch.insert.check.errors.sh"
+set srchost = (ipp100 ipp108 ipp112 ipp114)
+set srcvol  = (     0      0      1      0)
+set tgthost = (ipp161 ipp161 ipp162 ipp162)
+set tgtvol  = (     0      1      0      1)
+
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20230802
+
+if ($#argv == 0) then
+  echo "USAGE: $program launch"
+  echo "USAGE: $program run (Nentry)"
+  echo "   eg: $program run 1"
+  exit 2
+endif
+
+if ("$1" == "launch") then
+
+  # NOTE: the insert jobs run on the target machines, not source machines
+
+  set i = 1
+  while ($i <= $#srchost)
+    echo ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
+         ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
+    @ i++
   end
   exit 0
 endif
 
-set run = v0
-set version = 20220922
+if ("$1" == "run") then
+  if ($#argv != 2) then
+    echo "USAGE: $program run (Nentry)"
+    echo "   eg: $program run 1"
+    exit 2
+  endif
 
-set myhost = `hostname`
-set Nhost = `hostname | sed s/ipp//`
+  set N = $2
 
-# ipp100 - ipp117 (10 total) need to have  ~7TB moved
-# ipp123 - ipp126 ( 4 total) need to have  ~9TB moved
-# ipp134 - ipp139 ( 4 total) need to have ~12TB moved
+  set hn = $srchost[$N]
+  set hv = $srcvol[$N]
+  set tn = $tgthost[$N]
+  set tv = $tgtvol[$N]
 
-set target = NONE
-switch ($myhost)
-  # total of 23TB
-  case ipp100
-  case ipp101
-  case ipp123
-  set target = ipp153
-  breaksw;
+  set myhost = `hostname`
+  if ($hn != $myhost) then
+    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
+    exit 3
+  endif
 
-  # total of 35TB
-  case ipp102
-  case ipp104
-  case ipp124
-  case ipp136
-  set target = ipp154
-  breaksw;
+  echo "running $program on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  mkdir -p $hn.$hv
 
-  # total of 35TB
-  case ipp105
-  case ipp108
-  case ipp125
-  case ipp137
-  set target = ipp155
-  breaksw;
+  grep ERROR /data/$hn.$hv/nebulous/??/rebalance/movefiles.$version.chk >& $hn.$hv/errors.insert.check.$version.$run &
 
-  # total of 23TB
-  case ipp112
-  case ipp114
-  case ipp126
-  set target = ipp156
-  breaksw;
-
-  # total of 38TB
-  case ipp115
-  case ipp117
-  case ipp134
-  case ipp139
-  set target = ipp157
-  breaksw;
-endsw
-
-if ("$target" == "NONE") then
-  echo "need target"
-  exit 2
+  exit 0
 endif
-
-set v = 0 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/movefiles.$version.chk >& $h.$v/errors.insert.check.$version.$run &
-set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/movefiles.$version.chk >& $h.$v/errors.insert.check.$version.$run &
