HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How can I check a log with a script
Operating System - HP-UX
1835200
Members
2356
Online
110077
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2002 08:31 AM
11-15-2002 08:31 AM
How can I check a log with a script
Hi,
I want to run a script through cron aimed at following:
To see if the Sybase database backup successful.
To get error messages from its log file (see the attachment).
Thanks for those who will give me some solutions.
Yalin
I want to run a script through cron aimed at following:
To see if the Sybase database backup successful.
To get error messages from its log file (see the attachment).
Thanks for those who will give me some solutions.
Yalin
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2002 10:11 AM
11-15-2002 10:11 AM
Re: How can I check a log with a script
Why not just monitor the return code from the sybase backup?
OR
use grep with the "-e" option(s) to look for multiple KEYWORDS, like this:
grep -i -e "Backup Server" -e error ssprod_back.log
??
live free or die
harry
Live Free or Die
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2002 11:49 AM
11-15-2002 11:49 AM
Re: How can I check a log with a script
Actually, although I agree with the spirit of Harry's suggestion (grep is your friend), I would suggest that instead of looking for patterns you know represent errors, you should *exclude everything except the patterns you know are good*. That way when something unexpected pops up for the first time, you'll still catch it.
So again, what you do is build a list of the patterns you know you can ignore.
Then filter those out and let everything else come through - your goal should be to filter out everything you don't care about, so you only see the important stuff.
For example, you might use:
grep -v -e 'backup successful' -e 'startup successful' -e 'checkpoint completed' -e 'logged in at' -e 'new log file opened'.
Over time, keep adding to the list for log entries you want to ignore and you will end up with a nice log watcher.
Actually, there's already a system available to do exactly that, called logwatch. You'd probably have to adjust it a little to get it working on hpux, and you would definitely have to write a small module to plug your filter into.
Logwatch is probably overkill unless you plan on watching more than one type of log file.
http://www.logwatch.org/
So again, what you do is build a list of the patterns you know you can ignore.
Then filter those out and let everything else come through - your goal should be to filter out everything you don't care about, so you only see the important stuff.
For example, you might use:
grep -v -e 'backup successful' -e 'startup successful' -e 'checkpoint completed' -e 'logged in at' -e 'new log file opened'.
Over time, keep adding to the list for log entries you want to ignore and you will end up with a nice log watcher.
Actually, there's already a system available to do exactly that, called logwatch. You'd probably have to adjust it a little to get it working on hpux, and you would definitely have to write a small module to plug your filter into.
Logwatch is probably overkill unless you plan on watching more than one type of log file.
http://www.logwatch.org/
Hockey PUX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2002 08:24 AM
11-18-2002 08:24 AM
Re: How can I check a log with a script
Thanks Harry and Trever,
What will be the command if I want to grep the specific date? for instance, the following line shows:
Nov 13 04:33:55 2002: Backup Server: 4.15.2.2: Label validation error: seek to trailer labels failed.
It will show everything in the past if I do not indicate the date.Suggestions?
Yalin
What will be the command if I want to grep the specific date? for instance, the following line shows:
Nov 13 04:33:55 2002: Backup Server: 4.15.2.2: Label validation error: seek to trailer labels failed.
It will show everything in the past if I do not indicate the date.Suggestions?
Yalin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP