You can use system accounting on a daily or monthly basis. You can use the accounting programs to perform these tasks: Generates fiscal accounting summary reports on a monthly basis. You can remove from this script the commands for the accounting features you do not want to use.
Managing Serial Ports With the Service Access Facility (Tasks) 4. Displaying and Changing System Information (Tasks) 6.
For reference information about the various system accounting reports, see Chapter 10, System Accounting (Reference).
This section describes new or changed features in system accounting in the Oracle Solaris release.
Many operating systems provide facilities to somehow log user login sessions.
In many cases there are three types of queries which are of interest: The utmp(x) and wtmp(x) hold various types of records, namely user logins, user logouts, but also changes to the system clock and system reboots.
Most distro's also include this command (and its fellow commands) by default, as well.
It is written as a Perl script meant to be run from cron, with a configuration file and documentation available.Some time ago I spent some time working with utmp(x) and I noticed many applications/programmers make wrong assumptions about what it is, how it works and how to write applications that use it.This is why I decided to write an article about it, which is hopefully of any use to people who want to use this interface. My name is Ed Schouten and I am a developer at The Free BSD Project.Of course, knowing how to crack open wtmpx and get at anything and everything inside it is probably a more powerful skill to possess, but, if you're a simplest-is-best kind of guy like me, using a command that will allow you to get the last output with the year attached is perfect if you're looking to get your last output with the year attached.Seems almost self-evident ;)The command you can use is called "fwtmp" and exists in the "/usr/lib/acct" directory on Solaris and in many and varying places depending on your Linux distro (assuming your db is updated, commands like locate or slocate should make it easy to find).