Changeset 31253 for branches/czw_branch/20110406/tools/mysql-dump
- Timestamp:
- Apr 8, 2011, 6:31:08 PM (15 years ago)
- Location:
- branches/czw_branch/20110406
- Files:
-
- 6 edited
- 1 copied
-
. (modified) (1 prop)
-
tools/mysql-dump (modified) (1 prop)
-
tools/mysql-dump/gpc1_dump.sh (modified) (2 diffs)
-
tools/mysql-dump/gpc1_install.sh (modified) (4 diffs)
-
tools/mysql-dump/msg (copied) (copied from trunk/tools/mysql-dump/msg )
-
tools/mysql-dump/neb_dump.sh (modified) (2 diffs)
-
tools/mysql-dump/ops_dump.csh (modified) (5 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_dump.sh
r31210 r31253 15 15 . /home/panstarrs/ipp/mysql-dump/functions.sh 16 16 . /home/panstarrs/ipp/mysql-dump/password.sh 17 18 EMAILTO=schastel@ifa.hawaii.edu 17 19 18 20 HOST=ippc02 … … 43 45 if [ "$dump_status" -ne "0" ]; then 44 46 log ERROR "Sending warning e-mail" 45 email "Gpc1 dump failed" schastel@ifa.hawaii.edu"Check log file: /export/$HOST.0/mysql-dumps/gpc1_dump.log"47 email "Gpc1 dump failed" $EMAILTO "Check log file: /export/$HOST.0/mysql-dumps/gpc1_dump.log" 46 48 log INFO "End of gpc1 dump (Error)" 47 49 exit 1 -
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 -
branches/czw_branch/20110406/tools/mysql-dump/neb_dump.sh
r31213 r31253 12 12 . /home/panstarrs/ipp/mysql-dump/password.sh 13 13 14 EMAILTO=schastel@ifa.hawaii.edu 14 15 HOST=ippdb02 15 16 … … 36 37 if [ "$dump_status" -ne "0" ]; then 37 38 log ERROR "Sending warning e-mail" 38 email "Nebulous dump failed" schastel@ifa.hawaii.edu"Check log file: /export/ippdb02.0/mysql-dumps/neb-dump.log"39 email "Nebulous dump failed" $EMAILTO "Check log file: /export/ippdb02.0/mysql-dumps/neb-dump.log" 39 40 log INFO "End of nebulous dump (Error)" 40 41 exit 1 -
branches/czw_branch/20110406/tools/mysql-dump/ops_dump.csh
r31209 r31253 2 2 3 3 echo "## `/bin/date +%FT%T`" 4 5 set EMAILTO = schastel@ifa.hawaii.edu 4 6 5 7 # dump ippRequestServer from ippc19 … … 7 9 mysqldump --compress -hippc19 -uipp -pipp --flush-logs --single-transaction --log-error=RS-err ippRequestServer | gzip -9 > $DUMP_PATH/mysql-RS-ippc19-`date +%FT%T`.dump.gz 8 10 if ($status != 0) then 9 /bin/mail -s "Warning RS dump failed" schastel@ifa.hawaii.edu< msg11 /bin/mail -s "Warning ippRequestServer/RS dump failed" $EMAILTO < msg 10 12 endif 11 13 … … 16 18 mysqldump --compress -hippdb01 -uipp -pipp --flush-logs --single-transaction ippadmin | gzip -9 > $FILENAME 17 19 if ($status != 0) then 18 /bin/mail -s "Warning ippadmin dump failed" schastel@ifa.hawaii.edu< msg20 /bin/mail -s "Warning ippadmin dump failed" $EMAILTO < msg 19 21 endif 20 22 … … 31 33 mysqldump --compress -hippdb01 -uipp -pipp --flush-logs --single-transaction isp | gzip -9 > $FILENAME 32 34 if ($status != 0) then 33 /bin/mail -s "Warning isp dump failed" schastel@ifa.hawaii.edu< msg35 /bin/mail -s "Warning isp dump failed" $EMAILTO < msg 34 36 endif 35 37 … … 39 41 ln -f ../mysql-isp-ippdb01-$DATEVAR.dump.gz ippdb01-isp.dump.gz 40 42 41 # dump gpc1 from ippdb0142 #set DUMP_PATH = /data/ipp001.0/ipp/mysql-dumps #path(SAB)43 #set DATEVAR=`date +%FT%T` #date44 #set FILENAME = $DUMP_PATH/mysql-gpc1-ippc02-$DATEVAR.dump.gz #dump file name45 #mysqldump --compress -hippc -P3302 -uipp -pipp --flush-logs --single-transaction gpc1 | gzip -9 > $FILENAME46 #if ($status != 0) then47 # /bin/mail -s "Warning gpc1 dump failed" schastel@ifa.hawaii.edu < msg48 #endif49 50 # simlink to gpc1 ippdb01 dump51 #set DUMP_PATH = /data/ipp001.0/ipp/mysql-dumps #path(SAB)52 #cd $DUMP_PATH/distribution/ #link dir53 #ln -f ../mysql-gpc1-ippc02-$DATEVAR.dump.gz ippdb01-gpc1.dump.gz #hard link54 55 56 # dump the ippdb02 database57 #set DUMP_PATH = /data/ipp001.0/ipp/mysql-dumps #path58 #set DATEVAR = `date +%FT%T` #date59 #set FILENAME = $DUMP_PATH/mysql-neb-ippdb02-$DATEVAR.dump.gz #dump file name60 #mysqldump --compress -hippdb02 -ujhipp -pjhipp --flush-logs --single-transaction nebulous | gzip -9 > $FILENAME61 #if ($status != 0) then62 # /bin/mail -s "Warning nebulous dump failed" schastel@ifa.hawaii.edu < msg63 #endif64 65 # simlink to latest ippdb02 dump66 #set DUMP_PATH = /data/ipp001.0/ipp/mysql-dumps #path (SAB)67 #cd $DUMP_PATH/distribution/ #link dir68 #ln -f ../mysql-neb-ippdb02-$DATEVAR.dump.gz ippdb02.dump.gz #hard link69 70 # dump the ippdb00 database71 #set DUMP_PATH = /data/ipp001.0/ipp/mysql-dumps #path72 #set DATEVAR = `date +%FT%T` #date73 #set FILENAME = $DUMP_PATH/mysql-neb-ippdb00-$DATEVAR.dump.gz #dump file name74 #mysqldump --compress -hippdb00 -ujhipp -pjhipp --flush-logs --single-transaction nebulous | gzip -9 > $FILENAME75 #if ($status != 0) then76 # /bin/mail -s "Warning nebulous dump failed" schastel@ifa.hawaii.edu < msg77 #endif78
Note:
See TracChangeset
for help on using the changeset viewer.
