Way to use wtmp or "last" to gather total hours logged for a user?
Posted on 2007-03-23
I'm needing to figure out a way (util or command) to use the stats from wtmp or "last" output to basically show the total number of hours logged for a given user. I've had a few people putting a great deal of over time, and want to use this as a rough gauge of hours. I realize all the inaccuracies in doing this in terms of the fact that the individuals may not have acutally been working, etc. I'm hoping that maybe there's an easy way to take the longest session for a user each day, to avoid totalling hours of multiple sessions/logins they may have had going, and or avoiding over-lapping sessions.