IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 29, 2023, 9:11:20 AM (3 years ago)
Author:
eugene
Message:

making rebalance scripts a little easier to modify for different machines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rebalance/launch.rsync.check.sh

    r42314 r42534  
    11#!/bin/csh
    22
    3   set list = "ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
    4 # set list = "ipp105 ipp108 ipp112 ipp114 ipp115 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139"
    5 # set list = "ipp100 ipp101 ipp102 ipp104 ipp117"
     3set program = `basename $0`
    64
    7 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     5set run = v0
     6set version = 20230802
     7set mode = rsync.check
    88
    9 if ($#argv == 1) then
    10   if ("$1" != "launch") then
    11     echo "USAGE: launch.rsync.check.sh launch"
    12     exit 2
    13   endif
    14   foreach f ($list)
    15     echo ssh -f $f "cd $mydir && ./launch.rsync.check.sh"
    16          ssh -f $f "cd $mydir && ./launch.rsync.check.sh"
     9set srchost = (ipp100 ipp108 ipp112 ipp114)
     10set srcvol  = (     0      0      1      0)
     11set tgthost = (ipp161 ipp161 ipp162 ipp162)
     12set tgtvol  = (     0      1      0      1)
     13
     14set mydir = /data/ipphome1.0/home/eugene/rebalance.20230802
     15
     16if ($#argv == 0) then
     17  echo "USAGE: $program launch"
     18  echo "USAGE: $program run (Nentry)"
     19  echo "   eg: $program run 1"
     20  exit 2
     21endif
     22
     23if ("$1" == "launch") then
     24
     25  set i = 1
     26  while ($i <= $#srchost)
     27    echo ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     28         ssh -f $srchost[$i] "cd $mydir && ./$program run $i"
     29    @ i++
    1730  end
    1831  exit 0
    1932endif
    2033
    21 set run = v2
    22 set version = 20220922
     34if ("$1" == "run") then
     35  if ($#argv != 2) then
     36    echo "USAGE: $program run (Nentry)"
     37    echo "   eg: $program run 1"
     38    exit 2
     39  endif
    2340
    24 set myhost = `hostname`
    25 set Nhost = `hostname | sed s/ipp//`
     41  set N = $2
    2642
    27 set target = NONE
    28 switch ($myhost)
    29   # total of 23TB
    30   case ipp100
    31   case ipp101
    32   case ipp123
    33   set target = ipp153
    34   breaksw;
     43  set hn = $srchost[$N]
     44  set hv = $srcvol[$N]
     45  set tn = $tgthost[$N]
     46  set tv = $tgtvol[$N]
    3547
    36   # total of 35TB
    37   case ipp102
    38   case ipp104
    39   case ipp124
    40   case ipp136
    41   set target = ipp154
    42   breaksw;
     48  set myhost = `hostname`
     49  if ($hn != $myhost) then
     50    echo "ERROR: need to run $mode on the source host ($hn vs $myhost)"
     51    exit 3
     52  endif
    4353
    44   # total of 35TB
    45   case ipp105
    46   case ipp108
    47   case ipp125
    48   case ipp137
    49   set target = ipp155
    50   breaksw;
    51 
    52   # total of 23TB
    53   case ipp112
    54   case ipp114
    55   case ipp126
    56   set target = ipp156
    57   breaksw;
    58 
    59   # total of 38TB
    60   case ipp115
    61   case ipp117
    62   case ipp134
    63   case ipp139
    64   set target = ipp157
    65   breaksw;
    66 endsw
    67 
    68 if ("$target" == "NONE") then
    69   echo "need target"
    70   exit 2
     54  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
     55  mkdir -p $hn.$hv
     56  echo "./rebalance.mana $mode $hn $hv $tn $tv $version $version.$run.chk > & $hn.$hv/log.$mode.$version.$run &"
     57        ./rebalance.mana $mode $hn $hv $tn $tv $version $version.$run.chk > & $hn.$hv/log.$mode.$version.$run &
     58  exit 0
    7159endif
    72 
    73 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 &
    74 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 &
    75 
    76 # e.g.: ssh -f ipp127 "cd `pwd` && ./launch.rsync.check.sh"
Note: See TracChangeset for help on using the changeset viewer.