MichiganRon
MIS
In case it matters, I'm using Fedora Core 2.
I have a script which runs nightly and parses my Dansguardian and Squid log files looking for "DENIED". For each line which contains the searched text, that line is added to a "denied.log" file. At the end of the script, it emails me the log file.
I'd like to only get the email if there is something to report.
Here are the lines which do the work for the Dansguardian portion:
How can I check that the file size is greater than zero before I send the email?
Thanks,
Ron
“If you are irritated by every rub, how will you be polished?”
~ Mevlana Rumi
Do you live in Michigan? Join us in the Tek-Tips in Michigan forum.
I have a script which runs nightly and parses my Dansguardian and Squid log files looking for "DENIED". For each line which contains the searched text, that line is added to a "denied.log" file. At the end of the script, it emails me the log file.
I'd like to only get the email if there is something to report.
Here are the lines which do the work for the Dansguardian portion:
Code:
more /usr/local/dansguardian/access.log | grep *DENIED* > /usr/local/dansguardian/denied.log
cat /usr/local/dansguardian/denied.log | /usr/bin/Mail -s "Dansguardian Violation Log" me@mydomain.com
How can I check that the file size is greater than zero before I send the email?
Thanks,
Ron
“If you are irritated by every rub, how will you be polished?”
~ Mevlana Rumi
Do you live in Michigan? Join us in the Tek-Tips in Michigan forum.