- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Output of dmesg with a simple script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО12-19-2008 03:16 AM
тАО12-19-2008 03:16 AM
I have to run dmesg after every 5 minutes, could u give me a simple script with do while and sleep variable, through which the output of dmesg should be displayed automatically after 5 minutes. I know i can do it with cron tab, but i want a simple do while execution. Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2008 04:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2008 06:43 AM
тАО12-19-2008 06:43 AM
Re: Output of dmesg with a simple script
while :
do
x=$(date +%Y%m%d%H%M)
dmesg - >>$(( (x/5)*5 )).out
sleep 1
done
every 1 sec, it will get new dmesg and put it in a file named dateHM rounded to 5min.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2008 11:24 PM
тАО12-19-2008 11:24 PM
Re: Output of dmesg with a simple script
Thanks a lot for your reply. I got my answer and it was perfect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-20-2008 04:51 PM
тАО12-20-2008 04:51 PM
Re: Output of dmesg with a simple script
This option tells dmesg to only show something happened since the last time dmesg - was run. And it will add a time stamp if there is anything new. Just put this line in crontab:
0,10,20,30,40,50 * * * * /sbin/dmesg - >> /var/adm/dmesg.log
Now you'll have all dmesg lines logged automatically.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-21-2008 10:05 PM
тАО12-21-2008 10:05 PM