Dmesg with date possible?


 
Thread Tools Search this Thread
Operating Systems HP-UX Dmesg with date possible?
Prev   Next
# 13  
Old 03-19-2014
a thought - why not clear the messages everyday after storing it into a log file with current date? a cron should do.

---------- Post updated at 11:53 PM ---------- Previous update was at 11:48 PM ----------

I just noticed the logs are already rotated. Not sure if your system does it. Check these files
Code:
root@maximus:/tmp# ls -lrt /var/log/dmes*
-rw-r----- 1 root adm     28 Jan  8 09:39 /var/log/dmesg.4.gz
-rw-r----- 1 root adm  13463 Feb 17 00:53 /var/log/dmesg.3.gz
-rw-r----- 1 root adm  13376 Feb 17 19:41 /var/log/dmesg.2.gz
-rw-r----- 1 root adm  13544 Feb 19 19:57 /var/log/dmesg.1.gz
-rw-r----- 1 root adm  49431 Feb 23 12:36 /var/log/dmesg.0
-rw-r----- 1 root adm  49773 Mar  2 16:27 /var/log/dmesg

On a second thought I guess these are created either when the system boots up or shuts down.

---------- Post updated 03-19-14 at 12:00 AM ---------- Previous update was 03-18-14 at 11:53 PM ----------

Script log_dmesg
Code:
#!/bin/bash
echo "<< Log for $(date) >>" >> /var/log/mydmesg.log
dmesg >> /var/log/mydmesg.log
dmesg -C

Cron entry
Code:
0 0 * * * /path/to/your/script/log_dmesg

and may be include some log rotation logic if needed.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Dmesg errors

Dear All , Very recently I find there are a lot of I/O errors in our Red HAt Linux Server. Pl find the below end_request: I/O error, dev sdcp, sector 0 sd 7:0:0:32784: SCSI error: return code = 0x00010000 end_request: I/O error, dev sdn, sector 0 sd 7:0:0:33289: SCSI error: return... (7 Replies)
Discussion started by: jegaraman
7 Replies

2. Red Hat

Dmesg with Date and Time

Dear All, I am looking to enable Date and time in dmesg output for for centos 5.8. Unfortunately the current version doesn't support -T option. Also i am looking for solutions which can enable the date& time via kernal or updating the dmesg utility. or maybe via single command line. ... (3 Replies)
Discussion started by: pistachio
3 Replies

3. BSD

dmesg giving errors

When running dmesg, the output is a long list of the following: ACPI Error: No object attached to node 0xffffff00016622e0 20090521 exresnte-211 ACPI Error (uteval-0329): Method execution failed (Node 0xffffff00016622e0), AE_AML_NO_OPERAND As a workaround I resort to sysctl, which gives... (0 Replies)
Discussion started by: figaro
0 Replies

4. Linux

dmesg error

hi all, this is my permenent error.how to clear this error permenently... please help me out. here is my error output. please tell me clearly as i am very new to Linux(beginner) hda: packet command error: status=0x51 { DriveReady SeekComplete Error } hda: packet command error:... (2 Replies)
Discussion started by: rrlog
2 Replies

5. Slackware

Printer (dmesg) error

I am setting up a printer for a friend. I've built the box using (Gnu/Linux), Slackware-current, Kernel 2.6.7. I have the same setup. Currently the only way I have access to my friends machine is across the Internet via SSH, so I'm unable to manually check cabling at the moment. On my Slackware... (0 Replies)
Discussion started by: locustfurnace
0 Replies

6. HP-UX

dmesg error ??

Hi all, I have a very weard error message in my dmesg output, and I cannot find the solution in google. Does anyone know what it might be ? Equivalently mapped reserve pool exhausted; Overall application performance may be improved by increasing the "eqmemsize" tunable parameter (currently... (3 Replies)
Discussion started by: davidg
3 Replies

7. IP Networking

dmesg error

Oct 8 05:01:48 servername raid: Sense=7000060000000098000000003FD8000000000000000000000000000000000000000000000008380 00000000000000000000000FF0F053154303338343333353320202020202003010300000000000000000000000000000000000000000000000000000... (1 Reply)
Discussion started by: yls177
1 Replies

8. UNIX for Dummies Questions & Answers

dmesg error

hi, when i do a "dmesg" command, i saw many of this message appeared. Nov 12 07:00:20 catty graph_ftp: graph_ftp ftp faild it seems like it has some problems with my gftp application? pls tell me what's wrong and how to solve it. thanks alot. (1 Reply)
Discussion started by: champion
1 Replies

9. UNIX for Dummies Questions & Answers

dmesg freebsd

hey,i use freeBSD 4.7stable, dmesg returns me a tons of info like: ax R *Handler Int 16 aio_max R *Handler Int 17 aio_prio_delta_max R *Handler Int 18 delaytimer_max R *Handler Int 19 mq_open_max R *Handler Int 20 pagesize R *Handler Int 21 rtsig_max R *Handler Int... (6 Replies)
Discussion started by: hachik
6 Replies

10. UNIX for Dummies Questions & Answers

sun dmesg says

Oct 22 13:40:07 snmpdx: community_check() : bad community from Oct 22 13:40:07 snmpdx: session_open() failed for a pdu received from any help? thanks (4 Replies)
Discussion started by: yls177
4 Replies
Login or Register to Ask a Question
DATE(1) 						      General Commands Manual							   DATE(1)

NAME
date - print or set the date and time SYNOPSIS
date [-qsu] [[MMDDYY]hhmm[ss]] [+format] OPTIONS
-q Read the date from stdin -s Set the time (implicit for -q or a date string) -u Print the date as GMT -t Use this number of seconds instead of current time EXAMPLES
date # Print the date and time date 0221921610 # Set date to Feb 21, 1992 at 4:10 p.m. DESCRIPTION
With the -q flag or a numeric argument, date sets the GMT time and date. MMDDYY refers to the month, day, and year; hhmmss refers to the hour, minute and second. Each of the six fields must be exactly two digits, no more and no less. date always display the date and time, with the default format for the system. The -u flag request GMT time instead of local time. A format may be specified with a + followed by a printf-like string with the following options: %% % character %A Name of the day %B Name of the month %D mm/dd/yy %H Decimal hour on 2 digits %I Decimal hour modulo 12 on 2 digits %M Decimal minute on 2 digits %S Decimal seconds on 2 digits %T HH:MM:SS %U Decimal week number, Sunday being first day of week %W Decimal week number, Monday being first day of week %X Same as %T %Y Decimal year on 4 digits %Z Time Zone (if any) %a Abbreviated name of the day %b Abbreviated name of the month %c Appropriate date & time (default format) %d Decimal day of the month on 2 digits %e Same as %d, but a space replaces leading 0 %h Same as %b %j Decimal dey of the year on 3 digits %m Decimal month on 2 digits %n Newline character %p AM or PM %r 12-hour clock time with AM/PM %s Number of seconds since the epoch %t Tab character %w Decimal day of the week (0=Sunday) %x Same as %D %y Decimal year on 2 digits SEE ALSO
time(2), ctime(3), readclock(8). DATE(1)