ac command question


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users ac command question
# 1  
Old 10-02-2009
ac command question

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.

Last edited by hpg4815; 10-02-2009 at 01:37 PM..
# 2  
Old 10-05-2009
OK. .99 hours is one hour .50 is a half hour. Got that question resolved.

---------- Post updated at 02:58 PM ---------- Previous update was at 02:10 PM ----------

ok. the way the person created the accounts it seems to start a ssh-agent process. WHich is why we get to instances of a login when just logging into the local redhat box. The software starts another shell creating a third instance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Ls command question

I am scratching my head right now. I am trying to archive a ton of files in a directory. I am attempting to tar them by year. On our development server if I type ls *_2008* it returns all of the files I am expecting to see. (The format of the filename includes xx_xx_xxx_2008-09-29_xxx.xxxx.xxxx)... (8 Replies)
Discussion started by: jmartin99
8 Replies

2. UNIX for Dummies Questions & Answers

New to Unix command line and have a question about the "sort" command

I am going through the Unix Made Easy second edition book by John Muster. So far it's been very informative and I can tell it may be a bit out of date. In one of the exercises it talks about the "sort" command and using it to sort column's of data etc. The "sort" command has changed a bit and... (1 Reply)
Discussion started by: budfoxcat
1 Replies

3. UNIX for Dummies Questions & Answers

Question about why a command does this

$ echo 2 * 3 > 5 is a valid inequality. This will create a file in the current directory named '5' with the number '2' in it, the names of all the files in the current directory, followed by the number '3' and 'is a valid inequality.' What I do not understand is why 'is a valid inequality' gets... (2 Replies)
Discussion started by: guitarscn
2 Replies

4. UNIX for Dummies Questions & Answers

mv Command question

When I use the mv command like say, mv file1 ../, it will move file1 to the parent directory of my current working directory. But where would the file go if I do mv file ... (with 3 periods), where would this move file1? (4 Replies)
Discussion started by: MaStErXLY
4 Replies

5. Shell Programming and Scripting

while command question

Hi What does while ( : ); do ...... ...... ...... done; mean? Does "while ( : )" refer too while true? Thanks. (4 Replies)
Discussion started by: zmfcat1
4 Replies

6. UNIX for Dummies Questions & Answers

Command Question

What does 'directory=`pwd $1` ' mean, I know pwd is present working directory, so does that command take the present working directory of the directory the user is in depending on the varible ($1)? (2 Replies)
Discussion started by: Jayden
2 Replies

7. Solaris

cp command Question?

I am trying to following.. cp -rp oradata to /prod1 /prod2 /prod3 How I can copy oradata directory in to multiple directories? Thanks -Ad (1 Reply)
Discussion started by: deal732
1 Replies

8. Solaris

question about command

On Solaris 8 - what is the equal command to chfs. Thanks carson (3 Replies)
Discussion started by: cmackin
3 Replies

9. UNIX for Dummies Questions & Answers

question about using tr command

Hello all: I'm trying to use the tr command to change some text in a file, but it is not working as expected. Here's what I'm trying: tr 'INVOIC01' 'INVOICZZ' < inputfile > outputfile It looks to be changing not just the entire string, but any characters within. I just want to change the... (2 Replies)
Discussion started by: merliech
2 Replies

10. UNIX for Dummies Questions & Answers

question about rm command

i have a lot of messages file in the var directory i want to delete now i want to keep messages.1 to messages.10 and then delete everything else after 10 which is like 10 to 96 obviously i cant delete these files individual, can someone tell me the command to delete messages.11 to... (1 Reply)
Discussion started by: IMPTRUE
1 Replies
Login or Register to Ask a Question