- Timestamp:
- Apr 8, 2011, 6:31:08 PM (15 years ago)
- Location:
- branches/czw_branch/20110406
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
tools/mysql-dump (modified) (1 prop)
-
tools/mysql-dump/gpc1_install.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20110406
- Property svn:mergeinfo changed
/trunk (added) merged: 31218,31220-31231,31234-31240,31242-31244,31246-31251
- Property svn:mergeinfo changed
-
branches/czw_branch/20110406/tools/mysql-dump
- Property svn:ignore
-
old new 1 1 password.sh 2 *.log 3 .curr_gpc1_name
-
- Property svn:ignore
-
branches/czw_branch/20110406/tools/mysql-dump/gpc1_install.sh
r31211 r31253 9 9 # iterates up to $MAX_ITERATIONS times. 10 10 # 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: 13 12 # - Hard-links the gzipped MySQL dump in the distribution directory 14 13 # - Moves the MD5 checksum to the distribution directory 14 # 4) Import gpc1 into gpc1_0 or gpc1_1 (ensured by gpc1Import.py utility) 15 15 . /home/panstarrs/ipp/mysql-dump/functions.sh 16 16 … … 30 30 31 31 ITERATION=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 32 MD5_STATUS=1 33 while [ "$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 40 46 fi 41 fi 47 done 42 48 43 49 log INFO "Checking gpc1 backup file checksum" … … 45 51 BACKUP_FILE=`cat $TARGET/$MD5FILE | sed 's/^.* \//\//'` 46 52 BACKUP_FILE=`basename $BACKUP_FILE` 47 53 log INFO "Backup file is [$TARGET/$BACKUP_FILE]" 48 54 ACTUAL_MD5SUM=`/usr/bin/md5sum $TARGET/$BACKUP_FILE | sed 's/ .*$//'` 49 55 if [ "$ACTUAL_MD5SUM" != "$EXPECTED_MD5SUM" ]; then 50 56 log ERROR "Checksums are different: actual=[$ACTUAL_MD5SUM], expected=[$EXPECTED_MD5SUM]" 51 57 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)" 52 59 exit 2 53 60 fi 54 55 log INFO "Importing gpc1 backup file to gpc1_0 or gpc1_1"56 /usr/bin/python /home/panstarrs/ipp/mysql-dump/gpc1Import.py57 61 58 62 log INFO "Symlinking backup file [$TARGET/$BACKUP_FILE] to distribution [$DISTRIBUTION_TARGET]" … … 60 64 /usr/bin/mv -f $TARGET/$MD5FILE $DISTRIBUTION_MD5 61 65 66 # if it is between 0 and 4, ingest into gpc1_0 or gpc1_1 67 HOUR=`date +"%H"` 68 if [ "$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 71 else 72 log DEBUG "No gpc1 backup importation" 73 fi 74 75 log INFO "End of gpc1_install.sh (Success)" 76
Note:
See TracChangeset
for help on using the changeset viewer.
