Solved

Way to use wtmp or "last" to gather total hours logged for a user?

Posted on 2007-03-23
3
417 Views
Last Modified: 2013-11-17
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.

Any ideas?

0
Comment
Question by:derdle
  • 2
3 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 18784550
What problem are you solving?
0
 

Author Comment

by:derdle
ID: 18786204
I'm trying to show a rough number of hours logged in for a user.  For people, including myself who do a lot of work at home, in addition to the office work-  I'd just like to gather a rough number of hours.  I know there are better ways and methods for this that we're implementing, now that we have a need.  ...but the need came about abruptly and I need to go back a few months and get an idea of the hours that have been logged into the system.
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 18788193
http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/periodic/monthly/200.accounting

this shell script shows user login summaries in FreeBSD system without asking.

put it in your crontab or so.

another is to look at www.redbooks.ibm.com for AIX accounting, and using
http://www.redbooks.ibm.com/abstracts/sg246396.html?Open
for CPU minute accounting etc.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question