View previous topic :: View next topic |
Author |
Message |
geeksheik Tux's lil' helper
Joined: 07 Sep 2003 Posts: 99 Location: Zürich, Switzerland
|
Posted: Wed Nov 08, 2006 1:14 pm Post subject: nice trick: formatting the time code in emerge.log |
|
|
Greetings Fellow Gentoo Users/Devs:
I've been running several gentoo systems for years. While I love it, the only drawback IMHO is the compile time required. I often find myself watching the progress of emerge.log, comparing the compile times to that of other systems, and trying to figure out when a new package (or an upgrade) will be fully cooked.
As anyone else who's done this knows, the time format is in raw, unformatted unix time (the number of seconds since midnight on 1-1-1970). Translating this to hours:minutes:seconds, or trying to figure out exactly what date/time the last compile was has always been a pain in the ass for me.
So....today, I wrote a nice little bash one-liner to format the time within /var/log/emerge.log and display it humanistically:
# while read 'line' ; do echo "`date -u -d "1970-1-1 ${line/:*/} sec"`:${line#*:}" ; done
So, this can be used with tail -f , if your watching your log in real-time.
Code: | # tail -f /var/log/emerge.log | while read 'line' ; do echo "`date -u -d "1970-1-1 ${line/:*/} sec"`:${line#*:}" ; done |
Or, you could view an entire emerge.log within the less utility, for searching around for last compile date/time/lengths:
Code: | # cat /var/log/emerge.log | while read 'line' ; do echo "`date -u -d "1970-1-1 ${line/:*/} sec"`:${line#*:}" ; done | less |
I hope somebody finds this useful.
Cheers,
Bryant |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
|
Back to top |
|
|
bludger Guru
Joined: 09 Apr 2003 Posts: 389
|
Posted: Thu Nov 16, 2006 1:10 pm Post subject: |
|
|
As mentioned in the newletter, you can just use genlop. Eg. "genlop -l". |
|
Back to top |
|
|
truc Advocate
Joined: 25 Jul 2005 Posts: 3199
|
Posted: Sat Nov 18, 2006 3:00 pm Post subject: |
|
|
you can even use qlop from portage-utils, it will translate the time for you, make an average time and so on.. _________________ The End of the Internet! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|