View Single Post
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#22
Originally Posted by Wikiwide View Post
After reboot I cannot see the SGX errors in the log. The oldest lines are about the last reboot.
Correct, dmesg does not keep information across a reboot. I was suggesting adding a dump feature to the script to dump the logs before the reboot. That's a nice part about it being a script. Just about anything you can type on the command line can be added to the script and run as expected.

I
Originally Posted by Wikiwide View Post
Does dmesg >> output.txt overwrite output.txt or add new lines to it?
Using a single > overwrites, double > appends, so the above example would append to the output log. If you want to filter out a specific item, you can use grep in-line via pipes. For example to filter out "kb_lock", the line would look as follows:
Code:
dmesg | grep -v "kb_lock" >> output.txt
Personally, I'd say it's better to dump the whole dmesg log and filter it later if need be. If you filter it on the fly you may accidentally filter out something key in finding a pattern. (Eg if I had filtered SMS message arrival notices from mine I would have missed that an in-bound SMS happened just before each lockup in my case...)