Changeset 31211 for trunk/tools/mysql-dump/gpc1_install.sh
- Timestamp:
- Apr 6, 2011, 4:44:47 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/tools/mysql-dump/gpc1_install.sh (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/mysql-dump/gpc1_install.sh
r31209 r31211 1 1 #!/bin/bash 2 2 3 # This script is supposed to be executed on ipp001 3 # This script is supposed to be executed on ipp001 (HOST) 4 # 5 # It checks, 'installs', and 'distributes' the last gpc1 MySQL dump. 6 # The main steps are the following: 7 # 1) Check if a checksum file is available 8 # - if it is not, the script sleeps $SLEEPING_TIME seconds, and 9 # iterates up to $MAX_ITERATIONS times. 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: 13 # - Hard-links the gzipped MySQL dump in the distribution directory 14 # - Moves the MD5 checksum to the distribution directory 4 15 . /home/panstarrs/ipp/mysql-dump/functions.sh 16 17 EMAILTO=schastel@ifa.hawaii.edu 5 18 6 19 HOST=ipp001 … … 9 22 10 23 DISTRIBUTION_TARGET=$TARGET/distribution/ippdb01-gpc1.dump.gz 24 DISTRIBUTION_MD5=$TARGET/distribution/ippdb01-gpc1.md5 11 25 12 26 MAX_ITERATIONS=200 … … 22 36 if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then 23 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" 24 39 exit 1 25 40 fi … … 34 49 if [ "$ACTUAL_MD5SUM" != "$EXPECTED_MD5SUM" ]; then 35 50 log ERROR "Checksums are different: actual=[$ACTUAL_MD5SUM], expected=[$EXPECTED_MD5SUM]" 51 email "Invalid checksum for gpc1 backup" $EMAILTO "Checksums are different: actual=[$ACTUAL_MD5SUM], expected=[$EXPECTED_MD5SUM]" 36 52 exit 2 37 53 fi … … 42 58 log INFO "Symlinking backup file [$TARGET/$BACKUP_FILE] to distribution [$DISTRIBUTION_TARGET]" 43 59 /usr/bin/ln -f $TARGET/$BACKUP_FILE $DISTRIBUTION_TARGET 60 /usr/bin/mv -f $TARGET/$MD5FILE $DISTRIBUTION_MD5 44 61
Note:
See TracChangeset
for help on using the changeset viewer.
