IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 8, 2011, 6:31:08 PM (15 years ago)
Author:
watersc1
Message:

merge from trunk

Location:
branches/czw_branch/20110406
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20110406

  • branches/czw_branch/20110406/tools/mysql-dump

    • Property svn:ignore
      •  

        old new  
        11password.sh
         2*.log
         3.curr_gpc1_name
  • branches/czw_branch/20110406/tools/mysql-dump/gpc1_install.sh

    r31211 r31253  
    99#      iterates up to $MAX_ITERATIONS times.
    1010# 2) Check the gpc1 dump file against its checksum.
    11 # 3) Import gpc1 into gpc1_0 or gpc1_1 (ensured by gpc1Import.py utility)
    12 # 4) Distribute the validated files, that is:
     11# 3) Distribute the validated files, that is:
    1312#    - Hard-links the gzipped MySQL dump in the distribution directory
    1413#    - Moves the MD5 checksum to the distribution directory
     14# 4) Import gpc1 into gpc1_0 or gpc1_1 (ensured by gpc1Import.py utility)
    1515. /home/panstarrs/ipp/mysql-dump/functions.sh
    1616
     
    3030
    3131ITERATION=1
    32 if [ ! -s $TARGET/$MD5FILE ]; then
    33         log WARNING "MD5 file not found [$TARGET/$MD5FILE]. Waiting $SLEEPING_TIME seconds (Attempt: $ITERATION out of $MAX_ITERATIONS)"
    34         sleep $SLEEPING_TIME
    35         let ITERATION=ITERATION+1
    36         if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then
    37                 log ERROR "Copy of $TARGET/$MD5FILE failed after $ITERATION iterations. Giving up"
    38                 email "Too many failures when attempting to copy $TARGET/$MD5FILE" $EMAILTO "Check log"
    39                 exit 1
     32MD5_STATUS=1
     33while [ "$MD5_STATUS" -ne "0" ]; do
     34        if [ ! -s $TARGET/$MD5FILE ]; then
     35                log WARNING "MD5 file not found [$TARGET/$MD5FILE]. Waiting $SLEEPING_TIME seconds (Attempt: $ITERATION out of $MAX_ITERATIONS)"
     36                sleep $SLEEPING_TIME
     37                let ITERATION=ITERATION+1
     38                if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then
     39                        log ERROR "Copy of $TARGET/$MD5FILE failed after $ITERATION iterations. Giving up"
     40                        email "Too many failures when attempting to copy $TARGET/$MD5FILE" $EMAILTO "Check log"
     41                        log INFO "End of gpc1_install.sh (Failure)"
     42                        exit 1
     43                fi
     44        else
     45                MD5_STATUS=0
    4046        fi
    41 fi
     47done
    4248
    4349log INFO "Checking gpc1 backup file checksum"
     
    4551BACKUP_FILE=`cat $TARGET/$MD5FILE | sed 's/^.* \//\//'`
    4652BACKUP_FILE=`basename $BACKUP_FILE`
    47 
     53log INFO "Backup file is [$TARGET/$BACKUP_FILE]"
    4854ACTUAL_MD5SUM=`/usr/bin/md5sum $TARGET/$BACKUP_FILE | sed 's/ .*$//'`
    4955if [ "$ACTUAL_MD5SUM" != "$EXPECTED_MD5SUM" ]; then
    5056        log ERROR "Checksums are different: actual=[$ACTUAL_MD5SUM], expected=[$EXPECTED_MD5SUM]"
    5157        email "Invalid checksum for gpc1 backup" $EMAILTO "Checksums are different: actual=[$ACTUAL_MD5SUM], expected=[$EXPECTED_MD5SUM]"
     58        log INFO "End of gpc1_install.sh (Failure)"
    5259        exit 2
    5360fi
    54 
    55 log INFO "Importing gpc1 backup file to gpc1_0 or gpc1_1"
    56 /usr/bin/python /home/panstarrs/ipp/mysql-dump/gpc1Import.py
    5761
    5862log INFO "Symlinking backup file [$TARGET/$BACKUP_FILE] to distribution [$DISTRIBUTION_TARGET]"
     
    6064/usr/bin/mv -f $TARGET/$MD5FILE $DISTRIBUTION_MD5
    6165
     66# if it is between 0 and 4, ingest into gpc1_0 or gpc1_1
     67HOUR=`date +"%H"`
     68if [ "$HOUR" -lt "4" ]; then
     69        log INFO "Importing gpc1 backup file to gpc1_0 or gpc1_1"
     70        /usr/bin/python /home/panstarrs/ipp/mysql-dump/gpc1Import.py
     71else
     72        log DEBUG "No gpc1 backup importation"
     73fi
     74
     75log INFO "End of gpc1_install.sh (Success)"
     76
Note: See TracChangeset for help on using the changeset viewer.