Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.15 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. LOG_PATH="${HOME}/sdr-preservation-core/shared/log"
  4. LOG_FILES=$(cat <<FILENAMES
  5.     ${LOG_PATH}/sdr_sdrIngestWF_register-sdr.log
  6.     ${LOG_PATH}/sdr_sdrIngestWF_transfer-object.log
  7.     ${LOG_PATH}/sdr_sdrIngestWF_validate-bag.log
  8.     ${LOG_PATH}/sdr_sdrIngestWF_verify-agreement.log
  9.     ${LOG_PATH}/sdr_sdrIngestWF_complete-deposit.log
  10.     ${LOG_PATH}/sdr_sdrIngestWF_update-catalog.log
  11.     ${LOG_PATH}/sdr_sdrIngestWF_create-replica.log
  12.     ${LOG_PATH}/sdr_sdrIngestWF_ingest-cleanup.log
  13. FILENAMES
  14. )
  15.  
  16. today=$(date +%Y-%m-%d)
  17.  
  18. for f in ${LOG_FILES}; do
  19.     if [ -s ${f} ]; then
  20.         echo -e "\n\n********************************************************************************"
  21.         echo -e "ERRORS for $today in $f\n"
  22.         grep ${today} ${f} | grep -B1 -F 'ERROR'
  23.     else
  24.         echo -e "\n********************************************************************************"
  25.         echo -e "EMPTY: $f"
  26.     fi
  27. done
  28. for f in ${LOG_FILES}; do
  29.     if [ -s ${f} ]; then
  30.         echo -e "\n\n********************************************************************************"
  31.         echo -e "WARNINGS for $today in $f\n"
  32.         grep -F 'WARN' ${f} | grep -v 'resque-signals' | grep ${today}
  33.     fi
  34. done
  35. echo
  36. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement