Index: /branches/eam_branches/ipp-20220316/tools/eam/get.modules.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/get.modules.sh	(revision 42359)
+++ /branches/eam_branches/ipp-20220316/tools/eam/get.modules.sh	(revision 42359)
@@ -0,0 +1,13 @@
+#!/bin/csh
+
+set filelist = `cat perl.modules.txt perl.scripts.txt | grep -v "^ *#" `
+
+# lets find the number of scripts/modules which use each of the listed modules
+foreach module (`grep -v "^ *#" perl.modules.ext`)
+  set Nused = `grep "^ *use" $filelist | grep " $module" | grep -v "$module\:" | wc -l`
+  echo "*** $module : $Nused"
+  if ($Nused < 5) then
+    grep "^ *use" $filelist | grep " $module" | grep -v "$module\:"
+  endif     
+end
+  
Index: /branches/eam_branches/ipp-20220316/tools/eam/newnonlin/newnonlin.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/newnonlin/newnonlin.sh	(revision 42359)
+++ /branches/eam_branches/ipp-20220316/tools/eam/newnonlin/newnonlin.sh	(revision 42359)
@@ -0,0 +1,160 @@
+
+$NKNOTS = 15
+$SHOWPLOT = 0
+
+# the MJD-OBS field means these corrections are only
+# valid from 2009/11/15
+macro make.model.chip
+  if ($0 != 2)
+    echo "USAGE: make.model.chip (chipname)"
+    break
+  end
+
+  local i chip output detname
+  $chip = $1
+
+  list name -glob models.t0/$chip.xy??.txt
+  $output = nonlin.20230126.$chip.fits
+  $detname = $detName:$chip
+
+  mcreate phu 0 0
+  keyword phu ORIGIN   -w PS1
+  keyword phu TELESCOP -w PS1
+  keyword phu INSTRUME -w gpc1
+  keyword phu CONTROLR -w STARGRASP
+  keyword phu NAMPS    -wd 64
+  keyword phu MJD-OBS  -wf 55150
+  keyword phu DETECTOR -w $detname
+  wd phu $output
+
+  for i 0 $name:n
+    strlen $name:$i Nchar
+    substr $name:$i {$Nchar - 8} 4 extname
+    #echo $extname : $name:$i
+
+    make.model $name:$i $extname $output
+  end
+end
+
+macro make.model
+  if ($0 != 4)
+    echo "make.model (file) (extname) (output)"
+    echo "generate a spline fit to the model, selecting NKNOTS uniformly-spaced knots"
+    break
+  end
+
+  local i input extname output 
+  $input = $1
+  $extname = $2
+  $output = $3
+
+  data $input
+
+  read Xg 1 Yg 2
+  set lXg = log(Xg)
+
+  # select knots from the interpolated sequence which are
+  # evenly spaced in the log(x)
+
+  $lXmin = lXg[0]
+  $lXmax = lXg[-1]
+  $lXdel = ($lXmax - $lXmin) / $NKNOTS
+
+  # creates a vector with N+1 entries
+  create lXk 0 {$NKNOTS + 1}
+  lXk[0]  = $lXmin
+  lXk[-1] = $lXmax
+  set Yk = zero(lXk) + NAN
+  Yk[0]  = Yg[0]
+  Yk[-1] = Yg[-1]
+
+  # lXk[0] and lXk[Nknots] are already set above,
+  # this fills in the knots from lXk[1] to lXk[NKNOTS-1]
+  for i 1 $NKNOTS
+    $lXval = $lXmin + $lXdel * $i
+    lXk[$i] = $lXval
+    subset tvec = Yg where (lXg >= $lXval)
+    # vstat tvec
+    
+    # this step relies on tvec having the same order as Yg (except for the excluded entries)
+    Yk[$i] = tvec[0]
+  end
+
+  # we want the factor in the IPP code to be a multiplication, not a division
+  # we need to invert the factor from Hua's analysis:
+  set rYk = 1.0 / Yk
+
+  spline create $extname lXk rYk
+  spline save $extname $output -append
+
+  if ($SHOWPLOT) 
+    lim -n 2 lXg Yg; clear; box; resize 1200 900
+    lim -n 2 lXg Yg; clear; box; resize 1200 900
+    plot -n 2 -c red lXk Yk -pt x -sz 2
+    
+    spline apply $extname lXg YgFitLog
+    plot -n 2 -c blue -x line lXg YgFitLog -lw 2
+  end
+end
+
+# detName derived from ippconfig/gpc1/format_20100723.config
+$detName:XY01 = CCID58-2-15a1  
+$detName:XY02 = CCID58-2-18a1  
+$detName:XY03 = CCID58-2-04a2  
+$detName:XY04 = CCID58-1-01b1  
+$detName:XY05 = CCID58-1-09b1  
+$detName:XY06 = CCID58-2-09b1  
+$detName:XY10 = CCID58-2-22a1  
+$detName:XY11 = CCID58-2-01a1  
+$detName:XY12 = CCID58-3-11a1  
+$detName:XY13 = CCID58-3-06a1  
+$detName:XY14 = CCID58-3-05b1  
+$detName:XY15 = CCID58-3-08b1  
+$detName:XY16 = CCID58-1-02b1  
+$detName:XY17 = CCID58-2-07b2  
+$detName:XY20 = CCID58-1-19a1  
+$detName:XY21 = CCID58-1-04a1  
+$detName:XY22 = CCID58-2-09a2  
+$detName:XY23 = CCID58-1-02a1  
+$detName:XY24 = CCID58-3-10b1  
+$detName:XY25 = CCID58-3-05b2  
+$detName:XY26 = CCID58-3-04b1  
+$detName:XY27 = CCID58-1-18b1  
+$detName:XY30 = CCID58-3-13a2  
+$detName:XY31 = CCID58-3-05a1  
+$detName:XY32 = CCID58-2-01a2  
+$detName:XY33 = CCID58-1-02a2  
+$detName:XY34 = CCID58-3-03b1  
+$detName:XY35 = CCID58-1-01b2  
+$detName:XY36 = CCID58-3-14b1  
+$detName:XY37 = CCID58-2-23b2  
+$detName:XY40 = CCID58-3-02b1  
+$detName:XY41 = CCID58-1-03b2  
+$detName:XY42 = CCID58-1-07b1  
+$detName:XY43 = CCID58-2-11b2  
+$detName:XY44 = CCID58-2-09a1  
+$detName:XY45 = CCID58-3-04a2  
+$detName:XY46 = CCID58-3-02a1  
+$detName:XY47 = CCID58-3-14a1  
+$detName:XY50 = CCID58-1-17b1  
+$detName:XY51 = CCID58-2-09b2  
+$detName:XY52 = CCID58-1-04b1  
+$detName:XY53 = CCID58-1-05b2  
+$detName:XY54 = CCID58-3-05a2  
+$detName:XY55 = CCID58-3-03a2  
+$detName:XY56 = CCID58-3-02a2  
+$detName:XY57 = CCID58-3-11a2  
+$detName:XY60 = CCID58-2-16b1  
+$detName:XY61 = CCID58-1-03b1  
+$detName:XY62 = CCID58-3-03b2  
+$detName:XY63 = CCID58-1-02b2  
+$detName:XY64 = CCID58-1-07a1  
+$detName:XY65 = CCID58-2-04a1  
+$detName:XY66 = CCID58-3-10a1  
+$detName:XY67 = CCID58-1-09a1  
+$detName:XY71 = CCID58-2-13b1  
+$detName:XY72 = CCID58-1-14b1  
+$detName:XY73 = CCID58-3-11b2  
+$detName:XY74 = CCID58-1-05a2  
+$detName:XY75 = CCID58-1-21a1  
+$detName:XY76 = CCID58-2-05a1  
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.insert.check.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.insert.check.errors.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.insert.check.errors.sh	(revision 42359)
@@ -1,32 +1,68 @@
 #!/bin/csh 
 
-set run = v2
-set version = 20210702
+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
+
+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"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
 
 set myhost = `hostname`
 set Nhost = `hostname | sed s/ipp//`
 
+# 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 target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.insert.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.insert.errors.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.insert.errors.sh	(revision 42359)
@@ -1,32 +1,69 @@
 #!/bin/csh 
 
-set run = v2
-set version = 20210702
+# src machines:
+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
+
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: launch.insert.errors.sh launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./launch.insert.errors.sh"
+         ssh -f $f "cd $mydir && ./launch.insert.errors.sh"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
 
 set myhost = `hostname`
 set Nhost = `hostname | sed s/ipp//`
 
+# 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 target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.check.logs.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.check.logs.sh	(revision 42359)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.check.logs.sh	(revision 42359)
@@ -0,0 +1,76 @@
+#!/bin/csh 
+
+  set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+# set list = "ipp105 ipp108 ipp112 ipp114 ipp115 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+# set list = "ipp100 ipp101 ipp102 ipp104 ipp117"
+
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: launch.rsync.check.logs.sh launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./launch.rsync.check.logs.sh"
+         ssh -f $f "cd $mydir && ./launch.rsync.check.logs.sh"
+  end
+  exit 0
+endif
+
+## set the run value in rsync.check.logs.sh
+## set run = v2
+set version = 20220922
+
+set myhost = `hostname`
+set Nhost = `hostname | sed s/ipp//`
+
+set target = NONE
+switch ($myhost)
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
+  breaksw;
+
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
+  breaksw;
+
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
+  breaksw;
+
+  # 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
+endif
+
+set h = `hostname`; ./rsync.check.logs.sh > & $h.rsync.check.logs
+
+# e.g.: ssh -f ipp127 "cd `pwd` && ./launch.rsync.check.sh"
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.check.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.check.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.check.sh	(revision 42359)
@@ -1,6 +1,24 @@
 #!/bin/csh 
 
-set run = v4
-set version = 20210702
+  set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+# set list = "ipp105 ipp108 ipp112 ipp114 ipp115 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+# set list = "ipp100 ipp101 ipp102 ipp104 ipp117"
+
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: launch.rsync.check.sh launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./launch.rsync.check.sh"
+         ssh -f $f "cd $mydir && ./launch.rsync.check.sh"
+  end
+  exit 0
+endif
+
+set run = v2
+set version = 20220922
 
 set myhost = `hostname`
@@ -9,24 +27,40 @@
 set target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
@@ -37,6 +71,6 @@
 endif
 
-set v = 0 ; set h = `hostname` ; set t = $target; ./rebalance.mana rsync.check $h $v $t $v $version $version.chk > & $h.$v/log.rsync.check.$version.$run &
-set v = 1 ; set h = `hostname` ; set t = $target; ./rebalance.mana rsync.check $h $v $t $v $version $version.chk > & $h.$v/log.rsync.check.$version.$run &
+set v = 0 ; set h = `hostname` ; set t = $target; ./rebalance.mana rsync.check $h $v $t $v $version $version.$run.chk > & $h.$v/log.rsync.check.$version.$run &
+set v = 1 ; set h = `hostname` ; set t = $target; ./rebalance.mana rsync.check $h $v $t $v $version $version.$run.chk > & $h.$v/log.rsync.check.$version.$run &
 
 # e.g.: ssh -f ipp127 "cd `pwd` && ./launch.rsync.check.sh"
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.rsync.sh	(revision 42359)
@@ -1,6 +1,27 @@
 #!/bin/csh 
 
-set run = v2
-set version = 20210702
+# set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+# set list = "ipp105 ipp108 ipp112 ipp114 ipp115 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
+  set list = "ipp100 ipp101 ipp102 ipp104 ipp117"
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
+
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: launch.find.sh launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./launch.rsync.sh"
+         ssh -f $f "cd $mydir && ./launch.rsync.sh"
+#     echo ssh $f ps ux
+#          ssh $f ps ux
+#      ssh $f killall mana
+#      ssh $f killall find
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
 
 set myhost = `hostname`
@@ -9,24 +30,40 @@
 set target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.check.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.check.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.check.sh	(revision 42359)
@@ -1,6 +1,21 @@
 #!/bin/csh 
 
-set run = v2
-set version = 20210702
+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
+
+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"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
 
 set myhost = `hostname`
@@ -9,24 +24,40 @@
 set target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.empty.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.empty.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.empty.sh	(revision 42359)
@@ -1,6 +1,21 @@
 #!/bin/csh 
 
-set run = v2
-set version = 20210702
+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
+
+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"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
 
 set myhost = `hostname`
@@ -9,24 +24,40 @@
 set target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.errors.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.errors.sh	(revision 42359)
@@ -1,25 +1,65 @@
 #!/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
+
+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"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
+
+set myhost = `hostname`
 set Nhost = `hostname | sed s/ipp//`
 
-set ver = "v0"
-set verdate = "20201209"
+set target = NONE
+switch ($myhost)
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
+  breaksw;
 
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
+  breaksw;
 
-set target = NONE
-if (($Nhost > 101) && ($Nhost <= 111)) then 
-  set target = ipp145
-endif
-if ($Nhost > 111) then 
-  set target = ipp146
-endif
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
+  breaksw;
 
-if (($Nhost == 100) || ($Nhost == 101)) then
-  set target = ipp140
-  set v = 0 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$verdate.log >& $h.$v/errors.trash.$verdate.$ver &
-  set target = ipp133
-  set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$verdate.log >& $h.$v/errors.trash.$verdate.$ver &
-  exit 0
-endif
+  # 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
@@ -28,5 +68,5 @@
 endif
 
-set v = 0 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$verdate.log >& $h.$v/errors.trash.$verdate.$ver &
-set v = 1 ; set h = `hostname` ; set t = $target; grep ERROR /data/$h.$v/nebulous/??/rebalance/check.trash.$verdate.log >& $h.$v/errors.trash.$verdate.$ver &
+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 &
 
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/launch.trash.sh	(revision 42359)
@@ -1,6 +1,21 @@
 #!/bin/csh 
 
-set run = v2
-set version = 20210702
+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
+
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: launch.trash.sh launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./launch.trash.sh"
+         ssh -f $f "cd $mydir && ./launch.trash.sh"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
 
 set myhost = `hostname`
@@ -9,24 +24,40 @@
 set target = NONE
 switch ($myhost)
-  case ipp127
-  case ipp134
-  case ipp137
-  set target = ipp143
+  # total of 23TB
+  case ipp100
+  case ipp101
+  case ipp123
+  set target = ipp153
   breaksw;
 
-  case ipp128
-  case ipp135
-  case ipp138
-  set target = ipp144
+  # total of 35TB
+  case ipp102
+  case ipp104
+  case ipp124
+  case ipp136
+  set target = ipp154
   breaksw;
 
-  case ipp129
-  set target = ipp146
+  # total of 35TB
+  case ipp105
+  case ipp108
+  case ipp125
+  case ipp137
+  set target = ipp155
   breaksw;
 
-  case ipp130
-  case ipp136
+  # 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 = ipp147
+  set target = ipp157
   breaksw;
 endsw
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/rebalance.mana
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/rebalance.mana	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/rebalance.mana	(revision 42359)
@@ -8,5 +8,6 @@
 $EXEC = exec
 
-$BIGSIZE = 30M
+# BIGSIZE was 30M, but some machines do not have enough files that large 
+$BIGSIZE = 15M
 $TB_BYTE = 1024^4
 $VERSION = NONE
@@ -223,5 +224,5 @@
     while ($waitForDay)
       # check if we should run the next rsync at this time:
-      # only run except between HST = 19:00 - 05:00 or UT = 09:00 - 19:00 
+      # only run except between HST = 19:00 - 05:00 or UT = 05:00 - 15:00 
       ctimes -abs now -var tnow
       $thour = 24.0*($tnow - int($tnow))
@@ -242,5 +243,7 @@
 
     echo "rsyncing $srcdir/ to $tgtdir/ : $movelog"
+    break -auto off
     exec rsync -auv --files-from=$movelist $srcdir/ $tgtdir/ >& $movelog
+    break -auto on
   end
 end
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/rsync.check.logs.sh
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/rsync.check.logs.sh	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/rsync.check.logs.sh	(revision 42359)
@@ -1,5 +1,6 @@
 #!/bin/csh
 
-set version = 20210702
+set run = v2
+set version = 20220922
 
 set showlist = 0
@@ -22,18 +23,18 @@
 echo "--- volume 0 ---"
 if ($showlist) then
-  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$'
-  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep "No such file or directory" 
+  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$'
+  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep "No such file or directory" 
 else
-  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$' | wc -l
-  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep "No such file or directory" | wc -l
+  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$' | wc -l
+  cat /data/$myhost.0/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep "No such file or directory" | wc -l
 endif
 
 echo "--- volume 1 ---"
 if ($showlist) then
-  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$'
-  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep "No such file or directory" 
+  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$'
+  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep "No such file or directory" 
 else
-  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$' | wc -l
-  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.chk.2.log | grep "No such file or directory" | wc -l
+  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep -v "total size" | grep -v "building file list" | grep -v "bytes  received" | grep -v '^../$' | grep -v '^$' | wc -l
+  cat /data/$myhost.1/nebulous/??/rebalance/movefiles.$version.$run.chk.log | grep "No such file or directory" | wc -l
 endif
 
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.errors
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.errors	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.errors	(revision 42359)
@@ -1,18 +1,50 @@
-#!/bin/csh -f
+#!/bin/csh
 
-if ($#argv != 1) then
-  echo "USAGE: run.netstat.errors (hostname.vol)"
+if (($#argv == 1) && ("$1" == "help")) then
+  echo "USAGE: run.nebstat.errors"
+  echo "USAGE: run.nebstat.errors launch"
   exit 2
 endif
 
-set src = $1
-set run = v2
-set version = 20210702
+# src machines:
+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
+
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: run.nebstat.errors launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./run.nebstat.errors"
+         ssh -f $f "cd $mydir && ./run.nebstat.errors >& $f.nebstat.errors.log"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
+
+set myhost = `hostname`
+
+### volume 0:
+set src = $myhost.0
 
 rm -f $src/nebstat.errors.insert.$version.$run
 
 foreach f (`prcol 8 < $src/errors.insert.$version.$run`)
-  neb-stat `neb-reverse $f` >> $src/nebstat.errors.insert.$version.$run
-  echo $f
+  neb-stat `neb-reverse $f` >> $src/nebstat.errors.insert.$version.$run.stats
+  echo $f >> $src/nebstat.errors.insert.$version.$run.files
 end
 
+### volume 1:
+set src = $myhost.1
+
+rm -f $src/nebstat.errors.insert.$version.$run
+
+foreach f (`prcol 8 < $src/errors.insert.$version.$run`)
+  neb-stat `neb-reverse $f` >> $src/nebstat.errors.insert.$version.$run.stats
+  echo $f >> $src/nebstat.errors.insert.$version.$run.files
+end
+
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.insert.check.errors
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.insert.check.errors	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.insert.check.errors	(revision 42359)
@@ -1,16 +1,50 @@
 #!/bin/csh -f
 
-if ($#argv != 1) then
-  echo "USAGE: run.netstat.errors (hostname.vol)"
+if (($#argv == 1) && ("$1" == "help")) then
+  echo "USAGE: run.nebstat.insert.check.errors"
+  echo "USAGE: run.nebstat.insert.check.errors launch"
   exit 2
 endif
 
-set src = $1
+# src machines:
+set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
 
-rm -f $src/nebstat.errors.insert.check.20201209.v0
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
 
-foreach f (`prcol 5 < $src/errors.insert.check.20201209.v0`)
-  neb-stat `neb-reverse $f` >> $src/nebstat.errors.insert.check.20201209.v0
-  echo $f
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: run.nebstat.insert.check.errors launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./run.nebstat.insert.check.errors"
+         ssh -f $f "cd $mydir && ./run.nebstat.insert.check.errors >& $f.nebstat.insert.check.errors.log"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
+
+set myhost = `hostname`
+
+### volume 0:
+set src = $myhost.0
+
+rm -f $src/nebstat.errors.insert.check.$version.$run
+
+foreach f (`prcol 5 < $src/errors.insert.check.$version.$run`)
+  neb-stat `neb-reverse $f` >> $src/nebstat.errors.insert.check.$version.$run.stats
+  echo $f >> $src/nebstat.errors.insert.check.$version.$run.files
 end
 
+### volume 1:
+set src = $myhost.1
+
+rm -f $src/nebstat.errors.insert.check.$version.$run
+
+foreach f (`prcol 5 < $src/errors.insert.check.$version.$run`)
+  neb-stat `neb-reverse $f` >> $src/nebstat.errors.insert.check.$version.$run.stats
+  echo $f >> $src/nebstat.errors.insert.check.$version.$run.files
+end
+
Index: /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.trash.check.errors
===================================================================
--- /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.trash.check.errors	(revision 42358)
+++ /branches/eam_branches/ipp-20220316/tools/eam/rebalance/run.nebstat.trash.check.errors	(revision 42359)
@@ -1,16 +1,49 @@
 #!/bin/csh -f
 
-if ($#argv != 1) then
-  echo "USAGE: run.netstat.trash.check.errors (hostname.vol)"
+if (($#argv == 1) && ("$1" == "help")) then
+  echo "USAGE: run.nebstat.trash.check.errors"
+  echo "USAGE: run.nebstat.trash.check.errors launch"
   exit 2
 endif
 
-set src = $1
+# src machines:
+set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
 
-rm -f $src/nebstat.errors.trash.check.20201209.v0
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
 
-foreach f (`prcol 7 < $src/errors.trash.20201209.v0`)
-  neb-stat `neb-reverse $f` >> $src/nebstat.errors.trash.check.20201209.v0
-  echo $f
+if ($#argv == 1) then
+  if ("$1" != "launch") then
+    echo "USAGE: run.nebstat.trash.check.errors launch"
+    exit 2
+  endif
+  foreach f ($list)
+    echo ssh -f $f "cd $mydir && ./run.nebstat.trash.check.errors"
+         ssh -f $f "cd $mydir && ./run.nebstat.trash.check.errors >& $f.nebstat.trash.check.errors.log"
+  end
+  exit 0
+endif
+
+set run = v0
+set version = 20220922
+
+set myhost = `hostname`
+
+### volume 0:
+set src = $myhost.0
+
+rm -f $src/nebstat.errors.trash.check.$version.$run
+
+foreach f (`prcol 7 < $src/errors.trash.$version.$run`)
+  neb-stat `neb-reverse $f` >> $src/nebstat.errors.trash.check.$version.$run.stats
+  echo $f >> $src/nebstat.errors.trash.check.$version.$run.files
 end
 
+### volume 1:
+set src = $myhost.1
+
+rm -f $src/nebstat.errors.trash.check.$version.$run
+
+foreach f (`prcol 7 < $src/errors.trash.$version.$run`)
+  neb-stat `neb-reverse $f` >> $src/nebstat.errors.trash.check.$version.$run.stats
+  echo $f >> $src/nebstat.errors.trash.check.$version.$run.files
+end
