Name: sohk220 Date: April 24, 2007 at 12:52:11 Pacific Subject: parsing through messages for errors OS: Unix/Solaris CPU/Ram: 2GB Model/Manufacturer: Sun Blade 150
Comment:
Greetings everyone... I have an issue with a parsing script. My script is parsing through the messages file for "Warning|Panic|Error" messages. I wrote a simple script below.
How can I get the script to parse daily within a twelve hour period such as 8am to 8pm and so on for daily parse of that day only... hope someone can help me.... not really a scripting guys... just a beginner.. sorry...and hope someone can help me out
Thanks for the comment... I will try this out. Will this parse the messages for the day only? or will it parse through the entire log from previous days?
cron job is like the windows task scheduler. uu just set the date and time you want to run your script. check the man page for cron / crontab for more information
Well, no when I do that it mails me the entire log file that contains the variables "WARNING|ERROR|PANIC" that are old. I need something more to run every 15 minutes and begin again at the last line that is parsed through. That way if something is found, it will then email me.
Cron alone won't do this for you. You are going to have to write a script that saves the last line processed to a file, and then start at that point the next time the script starts.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE