Tuesday, May 13, 2025

Script to find the errors under specific directory

 script to find the errors under $FMW_HOME/user_projects/domains/EBS_domain/servers/


#!/bin/bash


# Set the base log directory

LOG_DIR="$FMW_HOME/user_projects/domains/EBS_domain/servers"


# Define output file

OUTPUT_FILE="fmw_error_report_$(date +%Y%m%d_%H%M%S).log"


# Print starting message

echo "Searching for errors under: $LOG_DIR"

echo "Results will be saved to: $OUTPUT_FILE"


# Find and search all relevant log files

find "$LOG_DIR" -type f -name "*.log" | while read -r file; do

    grep -Ei "ERROR|Exception|SEVERE" "$file" >> "$OUTPUT_FILE"

done


# Print completion message

echo "Search complete. Found errors are logged in: $OUTPUT_FILE"


No comments:

Post a Comment

Google, Mozilla, and Apple choosing to no longer support Entrust as a publicly trusted certificate authority

Google, Mozilla, and Apple have all decided to stop trusting Entrust’s publicly issued certificates after specific cutoff dates , due to lon...