They are two types of times in Portage:
Portage tree timestamp: /usr/portage/metadata/timestamp.chk:
Mon, 30 Dec 2013 09:15:01 +0000
Portage rsync completed time: sudo grep 'Sync completed' /var/log/emerge.log | tail -1:
1388397815: === Sync completed with rsync://140.110.123.9/gentoo-portage
This requires root since the log file is owned by portage user.
You can also use genlop -r or qlop -s for the list of rsync times.
I have dzen displaying the Portage tree timestamp, which adapted an older code used in Conky. Its perfectly okay to check the time with dzen, but sometimes, I just wanted to have the time right in terminal, so I decided to make a couple of one-liners as follow:
printf '%(%c)T\n' $(date -d "$(</usr/portage/metadata/timestamp.chk)" +%s) printf '%(%c)T\n' $(sudo grep 'Sync completed' /var/log/emerge.log | sed -n '$ s/:.*//p')
Sample output:
Mon 30 Dec 2013 05:15:01 PM CST Mon 30 Dec 2013 06:03:35 PM CST
Normally, both probably would only be a few hours apart at most. So, Portage tree timestamp should be more than enough.
0 comments:
Post a Comment