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

The Future of Oracle DBA in Kubernetes Era: OCI, OpenShift, and OSOK in Action

From DBA to Cloud-Native Engineer: Managing Databases on OCI with Kubernetes, OSOK & OpenShift A deep-dive for Oracle DBAs, Site Reliabi...