Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Provide a tool to migrate legacy data to new format #14

Open
normanr opened this issue Jul 2, 2024 · 3 comments
Open

Comments

@normanr
Copy link

normanr commented Jul 2, 2024

I'd like to be able to view my historical wtmp records using wtmpdb. Is there a way to migrate them into the new database format?

Maybe something that takes the output of utmpdump and creates an INSERT INTO statement would be sufficient?

@thkukuk
Copy link
Owner

thkukuk commented Jul 4, 2024

That was on my TODO list, but it's not as simple, since /var/log/wtmp has two entries, one for login, one for logout, while wtmpdb has only one for both. So you need to find the corresponding entries and merge them.
This is a big effort with little benefit, as you can simply continue to use the old last tool for the old wtmp files.
So current I have more important things on the list, I doubt this feature will really come.

@normanr
Copy link
Author

normanr commented Jul 5, 2024

ack. Debian recently dropped last from their util-linux package, and added wtmpdb as a suggestion, which is how I found out about it. It's not clear to me what the difference between wtmpdb and lastlog2 is and which Debian will prefer. They both look very similar.

@thkukuk
Copy link
Owner

thkukuk commented Jul 5, 2024

lastlog2 is the successor of lastlog, which did use /var/log/lastlog. It shows if an user was ever logged in and when was the last time, nothing more.

/var/log/wtmp is a log file which records when a user does login, when a user does logout, when the system boots or shutdown and similar events. last is one of the tools which did access /var/log/wtmp besides several others.
You can maybe replace lastlog with wtmp, but not the other way around.

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

No branches or pull requests

2 participants