'last' command anomaly

'last' command anomaly

Post by Bob Cree » Sun, 20 Aug 1995 04:00:00



The 'last' command doesn't seem to show a logout if there is no
matching login in the same wtmp file.  For example, if I logged in
at 10pm and ran 'runacct' at midnight and then logged out at 1pm, a
subsequent 'last' command shows no record of me for this day.

I really need that info for a program I'm writing.

Does anyone know how I can get the logout time from the accounting
records if the 'last' command doesn't show it?

Thanks.

Bob

=============================================================================

Computing & Communications Services
University of Guelph
Guelph, Ontario, Canada
=============================================================================

 
 
 

'last' command anomaly

Post by Lawrence Kirb » Sun, 20 Aug 1995 04:00:00




Quote:

>The 'last' command doesn't seem to show a logout if there is no
>matching login in the same wtmp file.  For example, if I logged in
>at 10pm and ran 'runacct' at midnight and then logged out at 1pm, a
>subsequent 'last' command shows no record of me for this day.

>I really need that info for a program I'm writing.

>Does anyone know how I can get the logout time from the accounting
>records if the 'last' command doesn't show it?

Check out the who command. e.g

who -a /etc/wtmp

will give you more information than you'll ever want. If you're coding in C
you should look at 'man getut' for a set of access routines.

--
-----------------------------------------


-----------------------------------------

 
 
 

1. 'last' command doesn't show complete login times

Hello,
I am trying to use the information from the "last" command to examine
how long users are logged into a certain machine for a research
project.  I wrote a perl script to parse the information into a comma
delimited file, opened it in a spreadsheet, and sorted the entries by
how long the users were logged in.  To my surprise, out of about 3200
entries, only 17 of them showed up as being logged in for more than an
hour!  I know this information is inaccurate, because these users work
on projects for hours at a time.  Another mystery is that when I run
"who", it shows about 50 users being logged in, whereas the "last"
command only shows about 10.  Running last using utmpx as the file
instead of the default wtmpx, it shows users being logged in for a lot
longer. (???)

I know that the "who" command uses the utmpx file, and the "last"
command uses the wtmpx file, but shouldn't the wtmpx file contain the
same information as the utmpx file, only a lot more of it?  Can anyone
think of an explanation to why the "last" output isn't showing the
entire session a user is logged in for?  Also, if there is data
missing, is there another way I can get the login and logout history
of all the users?

I would greatly appreciate any help you can give. :)

Thanks,
Julie

2. dip-i problems

3. Sun's 'last' command

4. How do I connect NDP model 447Z monitor to my SPARCserver 20?

5. The 'last' command doesn't record users logout

6. This should be easy...right?

7. Help: problems with 'w', 'who' and 'last'

8. TTY Help

9. the 'last' command

10. 'last' command 8 character username limit

11. Why has my 'last' command suddenly stopped working?

12. Piping results of a 'find' command to a 'mv' command...

13. ftp logging with 'last' command