I found this thread, but it was closed:
https://www.unix.com/unix-dummies-que...300-wtmpx.html
Computer at hand:
Linux BH087608 2.6.9-78.0.17.ELsmp #1 SMP Thu Mar 5 04:52:17 EST 2009 i686 i686 i386 GNU/Linux
Red Hat Enterprise Linux WS release 4 (Nahant Update 7)
Yes I know its old but this apparently is required.
COMMAND:
ac -p -d -f /var/log/wtmp.1 ( month of sept date 2009 daily logins for all users )
GOAL: To determine how long a user has used this redhat box for the month. This is for billing purposes so we know how much to charge for the use of the instrument.
SITUATION: The duration seems off (basically I have users with log on hours greater than the amount of hours in a month). I'm speculating that its because I have more then one entry for any one particular user when running the who command: After initial login I run the who command:
training :0 Oct 2 08:57
training pts/3 Oct 2 08:57 (:0.0)
After starting a program (name of program is topspin) the "who" command returns another instance of a login. Would this be why my logon hours are greater then they should be?
I'm interested in one of two things: One having the ac command only grab the duration for one instance of the 3 logins. Or using the ac command in correlation with the sa command to give me the duration of time that the topspin program was being used.
Last question, maybe I'm wrong, but what does the login time mean when it reports 1.99 when running the ac command? 2hrs 32mins?
Please help if you can, and thanks in advance.