Index: /trunk/tools/eam/rebalance/launch.nebstat.trash.check.errors.sh
===================================================================
--- /trunk/tools/eam/rebalance/launch.nebstat.trash.check.errors.sh	(revision 42549)
+++ /trunk/tools/eam/rebalance/launch.nebstat.trash.check.errors.sh	(revision 42549)
@@ -0,0 +1,67 @@
+#!/bin/csh 
+
+set program = `basename $0`
+
+set run = v0
+set version = 20230802
+set mode = trash.check
+
+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 <= $#tgthost)
+    echo ssh -f $tgthost[$i] "cd $mydir && ./$program run $i >& $srchost[$i].$srcvol[$i]/nebstat.errors.trash.check.$version.$run.log"
+         ssh -f $tgthost[$i] "cd $mydir && ./$program run $i >& $srchost[$i].$srcvol[$i]/nebstat.errors.trash.check.$version.$run.log"
+    @ i++
+  end
+  exit 0
+endif
+
+if ("$1" == "run") then
+  if ($#argv != 2) then
+    echo "USAGE: $program run (Nentry)"
+    echo "   eg: $program run 1"
+    exit 2
+  endif
+
+  set N = $2
+
+  set hn = $srchost[$N]
+  set hv = $srcvol[$N]
+  set tn = $tgthost[$N]
+  set tv = $tgtvol[$N]
+
+  set myhost = `hostname`
+  if ($tn != $myhost) then
+    echo "ERROR: need to run $mode on the target host ($tn vs $myhost)"
+    exit 3
+  endif
+
+  echo "running $program on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  mkdir -p $hn.$hv
+
+  rm -f $hn.$hv/nebstat.errors.trash.check.$version.$run.stats
+
+  foreach f (`prcol 7 < $hn.$hv/errors.trash.$version.$run`)
+    neb-stat `neb-reverse $f` >> $hn.$hv/nebstat.errors.trash.check.$version.$run.stats
+    echo $f >> $hn.$hv/nebstat.errors.trash.check.$version.$run.files
+  end
+
+  exit 0
+endif
Index: /trunk/tools/eam/rebalance/launch.trash.check.sh
===================================================================
--- /trunk/tools/eam/rebalance/launch.trash.check.sh	(revision 42548)
+++ /trunk/tools/eam/rebalance/launch.trash.check.sh	(revision 42549)
@@ -1,73 +1,60 @@
 #!/bin/csh 
 
-set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
-set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+set program = `basename $0`
 
-if ($#argv == 1) then
-  if ("$1" != "launch") then
-    echo "USAGE: launch.trash.check.sh launch"
-    exit 2
-  endif
-  foreach f ($list)
-    echo ssh -f $f "cd $mydir && ./launch.trash.check.sh"
-         ssh -f $f "cd $mydir && ./launch.trash.check.sh"
+set run = v0
+set version = 20230802
+set mode = trash.check
+
+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
+
+  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
 
-set target = NONE
-switch ($myhost)
-  # total of 23TB
-  case ipp100
-  case ipp101
-  case ipp123
-  set target = ipp153
-  breaksw;
+  set hn = $srchost[$N]
+  set hv = $srcvol[$N]
+  set tn = $tgthost[$N]
+  set tv = $tgtvol[$N]
 
-  # total of 35TB
-  case ipp102
-  case ipp104
-  case ipp124
-  case ipp136
-  set target = ipp154
-  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 ipp105
-  case ipp108
-  case ipp125
-  case ipp137
-  set target = ipp155
-  breaksw;
+  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  mkdir -p $hn.$hv
+  echo "./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &"
+        ./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$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; ./rebalance.mana trash.check $h $v $t $v $version > & $h.$v/log.trash.check.$version.$run &
-set v = 1 ; set h = `hostname` ; set t = $target; ./rebalance.mana trash.check $h $v $t $v $version > & $h.$v/log.trash.check.$version.$run &
-
-# e.g.: ssh -f ipp127 "cd `pwd` && ./launch.trash.check.sh"
Index: /trunk/tools/eam/rebalance/launch.trash.empty.sh
===================================================================
--- /trunk/tools/eam/rebalance/launch.trash.empty.sh	(revision 42548)
+++ /trunk/tools/eam/rebalance/launch.trash.empty.sh	(revision 42549)
@@ -1,73 +1,60 @@
 #!/bin/csh 
 
-set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
-set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+set program = `basename $0`
 
-if ($#argv == 1) then
-  if ("$1" != "launch") then
-    echo "USAGE: launch.trash.empty.sh launch"
-    exit 2
-  endif
-  foreach f ($list)
-    echo ssh -f $f "cd $mydir && ./launch.trash.empty.sh"
-         ssh -f $f "cd $mydir && ./launch.trash.empty.sh"
+set run = v0
+set version = 20230802
+set mode = empty.trash
+
+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
+
+  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
 
-set target = NONE
-switch ($myhost)
-  # total of 23TB
-  case ipp100
-  case ipp101
-  case ipp123
-  set target = ipp153
-  breaksw;
+  set hn = $srchost[$N]
+  set hv = $srcvol[$N]
+  set tn = $tgthost[$N]
+  set tv = $tgtvol[$N]
 
-  # total of 35TB
-  case ipp102
-  case ipp104
-  case ipp124
-  case ipp136
-  set target = ipp154
-  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 ipp105
-  case ipp108
-  case ipp125
-  case ipp137
-  set target = ipp155
-  breaksw;
+  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  mkdir -p $hn.$hv
+  echo "./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &"
+        ./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$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; ./rebalance.mana empty.trash $h $v $t $v $version > & $h.$v/log.empty.trash.$version.$run &
-set v = 1 ; set h = `hostname` ; set t = $target; ./rebalance.mana empty.trash $h $v $t $v $version > & $h.$v/log.empty.trash.$version.$run &
-
-# e.g.: ssh -f ipp127 "cd `pwd` && ./launch.trash.empty.sh"
Index: /trunk/tools/eam/rebalance/launch.trash.errors.sh
===================================================================
--- /trunk/tools/eam/rebalance/launch.trash.errors.sh	(revision 42548)
+++ /trunk/tools/eam/rebalance/launch.trash.errors.sh	(revision 42549)
@@ -1,72 +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 mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+set program = `basename $0`
 
-if ($#argv == 1) then
-  if ("$1" != "launch") then
-    echo "USAGE: launch.trash.errors.sh launch"
-    exit 2
-  endif
-  foreach f ($list)
-    echo ssh -f $f "cd $mydir && ./launch.trash.errors.sh"
-         ssh -f $f "cd $mydir && ./launch.trash.errors.sh"
+set run = v0
+set version = 20230802
+set mode = trash.errors
+
+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
 
-set target = NONE
-switch ($myhost)
-  # total of 23TB
-  case ipp100
-  case ipp101
-  case ipp123
-  set target = ipp153
-  breaksw;
+  set hn = $srchost[$N]
+  set hv = $srcvol[$N]
+  set tn = $tgthost[$N]
+  set tv = $tgtvol[$N]
 
-  # total of 35TB
-  case ipp102
-  case ipp104
-  case ipp124
-  case ipp136
-  set target = ipp154
-  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 ipp105
-  case ipp108
-  case ipp125
-  case ipp137
-  set target = ipp155
-  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 23TB
-  case ipp112
-  case ipp114
-  case ipp126
-  set target = ipp156
-  breaksw;
+  grep ERROR /data/$hn.$hv/nebulous/??/rebalance/check.trash.$version.log >& $hn.$hv/errors.trash.$version.$run &
 
-  # 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/check.trash.$version.log >& $h.$v/errors.trash.$version.$run &
-set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$version.log >& $h.$v/errors.trash.$version.$run &
-
