wilmington
Technical User
I am trying to check large files for errors. I though I would reduce the list by looking only for files modified in the last day.
find . \( -type d ! -name . -prune \) -o \( -type f -name "*log*" -mtime -1 -print \)
now I need to check for errors in the list of files but only want the errors for the current day.
sample log: Fri Fri Nov 29 06:06:03 2002 error:bad thing, you need to do something about it.
This will give me the day the errors happen.
find . \( -type d ! -name . -prune \) -o \( -type f -name "*log*" -mtime -2 -print \) | |xargs awk '/error:/{print $1}'
Need help on how to read only lines matching the current day then print the complete line with the offending error.
cheers
find . \( -type d ! -name . -prune \) -o \( -type f -name "*log*" -mtime -1 -print \)
now I need to check for errors in the list of files but only want the errors for the current day.
sample log: Fri Fri Nov 29 06:06:03 2002 error:bad thing, you need to do something about it.
This will give me the day the errors happen.
find . \( -type d ! -name . -prune \) -o \( -type f -name "*log*" -mtime -2 -print \) | |xargs awk '/error:/{print $1}'
Need help on how to read only lines matching the current day then print the complete line with the offending error.
cheers