Hello members,
I have some doubts on how to write a script that can reports success / failure of a batch job ?
-
Run a batch job:
-
Wait and search for a particular string in the Log file:
tail -f log01*.txt | egrep -v "^SUCCESSFUL"
echo "continue with the other tasks"
elsif
tail -f log01*.txt | egrep -v "^FAILURE"
echo "Process failed!!"
My questions are :
-
My batch job is likely to create a couple of logs with of type log01*.txt. How do I ensure the script scans through each of those logs to find either of the strings? I'm assuming the '*' can help me with this.
-
Do I continuously scan the log file ( that might still be in the "generation" state ) or wait until the logfile is created completely and then scan for a string ? In this case, how does the script detect that a particular log file has generated successfully, so that it can search for a string ?
Regards
Kris