IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2011, 4:44:47 PM (15 years ago)
Author:
Serge CHASTEL
Message:

Documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/mysql-dump/gpc1_install.sh

    r31209 r31211  
    11#!/bin/bash
    22
    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
    415. /home/panstarrs/ipp/mysql-dump/functions.sh
     16
     17EMAILTO=schastel@ifa.hawaii.edu
    518
    619HOST=ipp001
     
    922
    1023DISTRIBUTION_TARGET=$TARGET/distribution/ippdb01-gpc1.dump.gz
     24DISTRIBUTION_MD5=$TARGET/distribution/ippdb01-gpc1.md5
    1125
    1226MAX_ITERATIONS=200
     
    2236        if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then
    2337                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"
    2439                exit 1
    2540        fi
     
    3449if [ "$ACTUAL_MD5SUM" != "$EXPECTED_MD5SUM" ]; then
    3550        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]"
    3652        exit 2
    3753fi
     
    4258log INFO "Symlinking backup file [$TARGET/$BACKUP_FILE] to distribution [$DISTRIBUTION_TARGET]"
    4359/usr/bin/ln -f $TARGET/$BACKUP_FILE $DISTRIBUTION_TARGET
     60/usr/bin/mv -f $TARGET/$MD5FILE $DISTRIBUTION_MD5
    4461
Note: See TracChangeset for help on using the changeset viewer.