Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/configure.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/configure.sh	(revision 42620)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/configure.sh	(revision 42620)
@@ -0,0 +1,10 @@
+set run = v0
+set version = 20240129
+set srchost = (ipp144 ipp144 ipp145 ipp145 ipp146 ipp146 ipp147 ipp147)
+set srcvol  = (     0      1      0      1      0      1      0      1)
+set tgthost = (ipp163 ipp163 ipp163 ipp163 ipp163 ipp163 ipp163 ipp163)
+set tgtvol  = (     0      1      0      1      0      1      0      1)
+
+set fraction = 0.90
+set mydir = /data/ipphome1.0/home/eugene/rebalance.20240129
+
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.find.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.find.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.find.sh	(revision 42620)
@@ -1,22 +1,12 @@
 #!/bin/csh 
 
-set run = v0
-set version = 20230802
-
-# set mode to 'find' or 'find.test'
 set mode = find
-
-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
-set fraction = 0.90
+set program = `basename $0`
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
-  echo "USAGE: launch.find.sh launch"
-  echo "USAGE: launch.find.sh find (Nentry)"
-  echo "   eg: launch.find.sh find 1"
+  echo "USAGE: $program launch"
+  echo "USAGE: $program run (Nentry)"
+  echo "   eg: $program run 1"
   exit 2
 endif
@@ -26,19 +16,15 @@
   set i = 1
   while ($i <= $#srchost)
-    echo ssh -f $srchost[$i] "cd $mydir && ./launch.find.sh find $i"
-         ssh -f $srchost[$i] "cd $mydir && ./launch.find.sh find $i"
-#   echo ssh $f ps ux
-#        ssh $f ps ux
-#        ssh $f killall mana
-#        ssh $f killall find
-  @ i++
+    echo ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
+         ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
+    @ i++
   end
   exit 0
 endif
 
-if ("$1" == "find") then
+if ("$1" == "run") then
   if ($#argv != 2) then
-    echo "USAGE: launch.find.sh find (Nentry)"
-    echo "   eg: launch.find.sh find 1"
+    echo "USAGE: $program run (Nentry)"
+    echo "   eg: $program run 1"
     exit 2
   endif
@@ -53,9 +39,9 @@
   set myhost = `hostname`
   if ($hn != $myhost) then
-    echo "ERROR: need to run find on the source host ($hn vs $myhost)"
+    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
     exit 3
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 $fraction > & $hn.$hv/log.$mode.$version.$run &"
@@ -64,6 +50,6 @@
 endif
 
-echo "USAGE: launch.find.sh launch"
-echo "USAGE: launch.find.sh find (Nentry)"
-echo "   eg: launch.find.sh find 1"
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
 exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.find.test.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.find.test.sh	(revision 42620)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.find.test.sh	(revision 42620)
@@ -0,0 +1,55 @@
+#!/bin/csh 
+
+set mode = find.test
+set program = `basename $0`
+source $HOME/.rebalance.sh
+
+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
+
+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 ($hn != $myhost) then
+    echo "ERROR: need to run $mode on the source host ($hn 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
+  echo "./rebalance.mana $mode $hn $hv $tn $tv $version $fraction > & $hn.$hv/log.$mode.$version.$run &"
+        ./rebalance.mana $mode $hn $hv $tn $tv $version $fraction > & $hn.$hv/log.$mode.$version.$run &
+  exit 0
+endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.check.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.check.errors.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.check.errors.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = insert
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set mode = insert
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -22,6 +13,4 @@
 
 if ("$1" == "launch") then
-
-  # NOTE: the insert jobs run on the target machines, not source machines
 
   set i = 1
@@ -61,2 +50,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.check.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.check.sh	(revision 42620)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.check.sh	(revision 42620)
@@ -0,0 +1,57 @@
+#!/bin/csh 
+
+set mode = insert.check
+set program = `basename $0`
+source $HOME/.rebalance.sh
+
+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"
+         ssh -f $tgthost[$i] "cd $mydir && ./$program run $i"
+    @ 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
+  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 &
+  exit 0
+endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.errors.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.errors.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = insert
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set mode = insert
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -22,6 +13,4 @@
 
 if ("$1" == "launch") then
-
-  # NOTE: the insert jobs run on the target machines, not source machines
 
   set i = 1
@@ -60,2 +49,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.insert.sh	(revision 42620)
@@ -1,19 +1,7 @@
 #!/bin/csh 
 
+set mode = insert
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-
-# set to 'insert' first, then run with 'insert.check'
-# set mode = insert
-set mode = insert.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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -53,9 +41,9 @@
   set myhost = `hostname`
   if ($tn != $myhost) then
-    echo "ERROR: need to run $mode on the source host ($tn vs $myhost)"
+    echo "ERROR: need to run $mode on the target host ($tn vs $myhost)"
     exit 3
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 &"
@@ -64,2 +52,6 @@
 endif
 
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.location.check.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.location.check.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.location.check.sh	(revision 42620)
@@ -1,3 +1,9 @@
 #!/bin/csh 
+
+## XXX update this
+echo "UPDATE ME"
+exit 2
+
+### XXX this needs to modified in each directory
 
 if ($#argv != 1) then
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.nebstat.insert.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.nebstat.insert.errors.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.nebstat.insert.errors.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = insert
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set mode = insert
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -66,2 +57,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.nebstat.trash.check.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.nebstat.trash.check.errors.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.nebstat.trash.check.errors.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = trash.check
 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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -66,2 +57,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.check.logs.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.check.logs.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.check.logs.sh	(revision 42620)
@@ -1,21 +1,14 @@
 #!/bin/csh 
 
+set mode = rsync.check.logs
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set stage = rsync.check.logs
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
-  echo "USAGE: $program launch (mode)"
-  echo "USAGE: $program run (mode) (Nentry)"
+  echo "USAGE: $program launch (command)"
+  echo "USAGE: $program run (command) (Nentry)"
+  echo "   (command) = show or count"
   echo "   eg: $program run show 1"
+  echo "   eg: $program run count 1"
   exit 2
 endif
@@ -34,10 +27,10 @@
 if ("$1" == "run") then
   if ($#argv != 3) then
-    echo "USAGE: $program run (mode) (Nentry)"
+    echo "USAGE: $program run (command) (Nentry)"
     echo "   eg: $program run show 1"
     exit 2
   endif
 
-  set mode = $2
+  set command = $2
   set N = $3
 
@@ -49,12 +42,19 @@
   set myhost = `hostname`
   if ($hn != $myhost) then
-    echo "ERROR: need to run $stage on the source host ($hn vs $myhost)"
+    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
     exit 3
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv for stage $stage, version $version"
+  echo "running on $myhost for source $hn.$hv to target $tn.$tv for mode $mode, version $version"
   mkdir -p $hn.$hv
-  echo "./rsync.check.logs.sh $mode $hn $hv $version $run > & $hn.$hv/log.$stage.$version.$run &"
-        ./rsync.check.logs.sh $mode $hn $hv $version $run > & $hn.$hv/log.$stage.$version.$run &
+  echo "./rsync.check.logs.sh $command $hn $hv $version $run > & $hn.$hv/log.$mode.$version.$run &"
+        ./rsync.check.logs.sh $command $hn $hv $version $run > & $hn.$hv/log.$mode.$version.$run &
   exit 0
 endif
+
+echo "USAGE: $program launch (command)"
+echo "USAGE: $program run (command) (Nentry)"
+echo "   (command) = show or count"
+echo "   eg: $program run show 1"
+echo "   eg: $program run count 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.check.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.check.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.check.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = rsync.check
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set mode = rsync.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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -52,5 +43,5 @@
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 $version.$run.chk > & $hn.$hv/log.$mode.$version.$run &"
@@ -58,2 +49,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.rsync.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = rsync
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set mode = rsync
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -52,5 +43,5 @@
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 &"
@@ -58,2 +49,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.check.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.check.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.check.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = trash.check
 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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -52,5 +43,5 @@
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 &"
@@ -59,2 +50,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.empty.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.empty.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.empty.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = empty.trash
 set program = `basename $0`
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -52,5 +43,5 @@
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 &"
@@ -59,2 +50,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.errors.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.errors.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.errors.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = trash.errors
 set program = `basename $0`
-
-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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -22,6 +13,4 @@
 
 if ("$1" == "launch") then
-
-  # NOTE: the insert jobs run on the target machines, not source machines
 
   set i = 1
@@ -61,2 +50,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.sh
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.sh	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/launch.trash.sh	(revision 42620)
@@ -1,16 +1,7 @@
 #!/bin/csh 
 
+set mode = trash
 set program = `basename $0`
-
-set run = v0
-set version = 20230802
-set mode = 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
+source $HOME/.rebalance.sh
 
 if ($#argv == 0) then
@@ -52,5 +43,5 @@
   endif
 
-  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
+  echo "running $program 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 &"
@@ -58,2 +49,7 @@
   exit 0
 endif
+
+echo "USAGE: $program launch"
+echo "USAGE: $program run (Nentry)"
+echo "   eg: $program run 1"
+exit 2
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/neb_make_movelist.pl
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/neb_make_movelist.pl	(revision 42620)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/neb_make_movelist.pl	(revision 42620)
@@ -0,0 +1,48 @@
+#! /usr/bin/env perl
+
+# check usage
+if (@ARGV < 1) { &usage; }
+if ($ARGV[0] eq "help") { &usage; }
+
+my $biglist = $ARGV[0];
+
+open (BIGLIST, $biglist) or die "cannot open list of files $biglist\n";
+my @bigfiles = <BIGLIST>;
+close (BIGLIST);
+
+my %filesizes;
+
+for (my $i = 0; $i < @bigfiles; $i++) {
+
+    my $bigfile = $bigfiles[$i];
+    chomp $bigfile;
+    
+    # skip files that match these patterns:
+    if ($bigfile =~ 'tgz$') { next; } # exclude bundles (linked on datastore)
+
+    $filesizes{$bigfile} = -s $bigfile;
+
+    # print "in: $bigfile = $filesizes{$bigfile}\n";
+}
+
+my @keys = sort { $filesizes{$b} <=> $filesizes{$a} } keys(%filesizes);
+# my @keys = keys(%filesizes);
+
+for ($i = 0; $i < @keys; $i++) {
+    my $file = $keys[$i];
+    my $size = $filesizes{$file};
+    print STDOUT "$file $size\n";
+}
+
+exit 0;
+
+######
+
+sub usage {
+    print STDOUT "USAGE: neb_make_movelist.pl (biglist)\n";
+    &goodbye;
+}
+
+sub goodbye {
+    die "@_\n";
+}
Index: /branches/eam_branches/ipp-20230313/tools/eam/rebalance/rebalance.mana
===================================================================
--- /branches/eam_branches/ipp-20230313/tools/eam/rebalance/rebalance.mana	(revision 42619)
+++ /branches/eam_branches/ipp-20230313/tools/eam/rebalance/rebalance.mana	(revision 42620)
@@ -163,5 +163,10 @@
 
 #   list files -x "/bin/ls -l `cat $filelist` | sort -k 5nr"
-    list files -x "./neb_make_movelist.sh $filelist"
+
+#   this shell script returned the output of ls -l (filesize = word[4], filename = word[8])
+#   list files -x "./neb_make_movelist.sh $filelist"
+
+#   this perl script returns the filename and size only
+    list files -x "./neb_make_movelist.pl $filelist"
 
     # generate subset list to match goal size
@@ -170,6 +175,9 @@
     while (($Ntotal < $NremoveSub) && ($j < $files:n))
       list word -split $files:$j
-      $keep:$j = $word:8
-      $Ntotal += $word:4
+#     $keep:$j = $word:8
+#     $Ntotal += $word:4
+      $keep:$j = $word:0
+      $Ntotal += $word:1
+
       # echo $word:4 $Ntotal : $NremoveSub $keep:$j
       $j ++
