Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Access to oldest log (fix proposed) - Ubuntu 16.04 #4

Open
gustawdaniel opened this issue Dec 2, 2016 · 3 comments
Open

Access to oldest log (fix proposed) - Ubuntu 16.04 #4

gustawdaniel opened this issue Dec 2, 2016 · 3 comments

Comments

@gustawdaniel
Copy link

gustawdaniel commented Dec 2, 2016

Hi

Your script is AWESOME! But today I was confused by short time of history displayed in program. I fixed it. Please look at the screen.

  • On the right side is version that use oldest logs - with my modification.
  • On the left side is version from this repository - original version.

rawhen_fix

Command wc /var/log/wtpm* calculates lines of files with temporal log this month wtmp and oldest wtmp.1.

My fixture is simple and changes line:

163 | command = "last -R -F reboot"

to

163 | command = "last -R -F reboot -f /var/log/wtmp.1"

In your docs I see that by "last -R -F reboot" you have access to 83 days of history. But It was 4 years ago. Probably somethings was changed in logging mechanisms of Ubuntu. My fix allow to get only 28 days.

It is possible, that best solution is concatenate results of these commands. But I don't know rules that assign content of these logs. I asked about this on askubuntu.com

Sources:

question about old logs askubuntu.com
my extended question on askubuntu.com

@p-e-w
Copy link
Owner

p-e-w commented Dec 11, 2016

Not sure if that's actually a fix. If wtmp log rotation works as I expect, /var/log/wtmp.1 would actually be missing the most recent login entries. Please correct me if I've misunderstood.

@gustawdaniel
Copy link
Author

gustawdaniel commented Dec 21, 2016

I would like to help solve this problem, but my skill is to low. My question on askubuntu remain without answer. I suspect that that wtpm have config that allow to prevent deleting logs. Maybe simpler, but less correct approach is add cron task that save interesting data to other location.

@gustawdaniel
Copy link
Author

I obtained answer.

https://askubuntu.com/questions/856199/access-to-logs-of-startup-and-shut-down

So I propose to write about log mechanism of rotation of logs introduced in in ubuntu 16 and close this issue :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants