IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2023, 9:44:22 AM (3 years ago)
Author:
eugene
Message:

updates to rawfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/check.rawfix.sh

    r42399 r42400  
    1616set DBPASS = "dvo"
    1717
    18 set DBOPTS = "-B --skip-column-names -h $DBHOST -u $DBUSER -p$DBPASS $DBNAME"
     18# set DBOPTS = "-B --skip-column-names -h $DBHOST -u $DBUSER -p$DBPASS $DBNAME"
     19set DBOPTS = "-B -h $DBHOST -u $DBUSER -p$DBPASS $DBNAME"
     20
     21if ($mode == "all") then
     22  if ($#argv != 1) then
     23    echo "USAGE: check.rawfix.sh all"
     24    exit 2
     25  endif
     26
     27  mysql $DBOPTS -e "select dateobs, state from nights"
     28  exit 0
     29endif
     30
     31if ($mode == "stats") then
     32  if ($#argv != 1) then
     33    echo "USAGE: check.rawfix.sh stats"
     34    exit 2
     35  endif
     36
     37  mysql $DBOPTS -e "select count(dateobs) Nnights, state from nights group by state"
     38  exit 0
     39endif
    1940
    2041if ($mode == "night") then
     
    2950endif
    3051
    31 if ($mode == "new") then
    32   mysql $DBOPTS -e "select dateobs from nights where (state = 'new')"
     52if ($mode == "state") then
     53  if ($#argv != 2) then
     54    echo "USAGE: check.rawfix.sh state (state)"
     55    exit 2
     56  endif
     57
     58  set mystate = $2
     59
     60  if ($mystate == "new") goto good_state
     61  if ($mystate == "rsync") goto good_state
     62  if ($mystate == "md5sum.new") goto good_state
     63
     64  echo "ERROR: unknown mode $mystate"
     65  exit 2
     66
     67  good_state:
     68  mysql $DBOPTS -e "select dateobs from nights where (state = '$mystate')"
    3369  exit 0
    3470endif
Note: See TracChangeset for help on using the changeset viewer.