HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: monitor a log file
Operating System - HP-UX
1833877
Members
1840
Online
110063
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
06-16-2005 05:17 PM
06-16-2005 05:17 PM
monitor a log file
hey,
i have a log file which gets updated every minute. I need to create a script which monitors the log file , if it doesnt update for 5 minutes then send me an email.
I can put this cron and run every 5 min.
Is there any way i can write a script or use a find command?
The log file time stamp is in GMT!
thanks,
i have a log file which gets updated every minute. I need to create a script which monitors the log file , if it doesnt update for 5 minutes then send me an email.
I can put this cron and run every 5 min.
Is there any way i can write a script or use a find command?
The log file time stamp is in GMT!
thanks,
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2005 07:43 PM
06-16-2005 07:43 PM
Re: monitor a log file
You can try this as,
#!/bin/sh
cd
touch newfile
find . -type f -newerm newfile
rm -f newfile
Put this file in cron to execute for every 5 minutes.
hth.
#!/bin/sh
cd
touch newfile
find . -type f -newerm newfile
rm -f newfile
Put this file in cron to execute for every 5 minutes.
hth.
Easy to suggest when don't know about the problem!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2005 08:08 PM
06-16-2005 08:08 PM
Re: monitor a log file
Hi Sachin
maybe something like that ?
#!/usr/bin/ksh
while true
do
touch /tmp/timefile
sleep 300
if test /tmp/timefile -nt /tmp/yourlogfile ; then
echo "timefile newer than yourlogfile" | mail root
else
echo "yourlogfile acceded since five minutes"
fi
done
Joel
maybe something like that ?
#!/usr/bin/ksh
while true
do
touch /tmp/timefile
sleep 300
if test /tmp/timefile -nt /tmp/yourlogfile ; then
echo "timefile newer than yourlogfile" | mail root
else
echo "yourlogfile acceded since five minutes"
fi
done
Joel
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