User log in info

Hi,
I am using SunOS and HP-UX. I am trying to removed user that has not been using the system for a period of time. Is there anyway to find out how long since the last time the user logged on. I know there is command "last" that read from the file /etc/wtmp that hold some of information. However, information is deleted as the file get too large.
Besides of that way, is there anyother way?
Thanks in advance,
Vu

A couple of workarounds here, but ideally you would want to use the last file.

You might want to think about truncating the last file upto a certain period instead of removing the whole file - that way you'd always have enough data in there to assess whether you want to delete or not.

Or you could find a list of .profile files that were last accessed greater than a certain period of time....

Or you could add a variable to the .profile file for each user that sets say 'last_accessed=date'. Then you could parse the .profile files and find ones that have old dates. Each time a user signed in the variable would be updated - so if it's an old date it means they haven't logged in for a while.