Sponsored Content
Top Forums UNIX for Advanced & Expert Users Users logged in longer than machine uptime? Post 302114532 by jgt on Monday 16th of April 2007 10:27:24 PM
Old 04-16-2007
uptime and w

Both these programs use the same man page, and the same files.
File /etc/utmp and /etc/wtmp are used to calculate who is logged on, and for how long.
My guess is that one of these has been corrupted.
Are you running out of disk space 'no space on dev (1/42)' messages on the console, or in /usr/adm/messages?
Did the system crash?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Information about users who have logged.

Hi, Suppose I have a programme called Menu. This menu has various choices as we would expect from a Menu. Now Can you Please help me as I want the details of the Users to be registered to some file , Whoever has entered this particular Program . Basically to see the username and the time that... (2 Replies)
Discussion started by: rooh
2 Replies

2. IP Networking

All tcp/ip users are logged out

I have an RS6000 server running AIX and on occasion all users are logged out of the server "connection closed by foreign host" is the error message. Normally a user can press enter and get a Login prompt, but they get the message "connection refused" and then the users can wait a minute or so and... (2 Replies)
Discussion started by: Docboyeee
2 Replies

3. UNIX for Dummies Questions & Answers

How to know what users are logged in to account

hello all say im logged in to account ar root , but I can't change any thing there ( like username ) if someone is already logged in also . how can I know who is ( user name ) also connected to the user im using ? (2 Replies)
Discussion started by: umen
2 Replies

4. Shell Programming and Scripting

how many users logged

in unix what is the syntax to find out how many users are currently logged in (4 Replies)
Discussion started by: trichyselva
4 Replies

5. AIX

uptime reports differntly for different users

when i run uptime as root i get the following result (which is incorrect) uptime 14:33pm up -176 days, -11:-38, 0 users, load average: 4.59, 4.16, 4.03 when i run it as a normal user i get the following (which is correct) uptime 02:33PM up 320 days, 15:02, 6 users, load... (1 Reply)
Discussion started by: zuessh
1 Replies

6. Post Here to Contact Site Administrators and Moderators

logged out users

how to find out users who logged out within 5 minutes (1 Reply)
Discussion started by: roshni
1 Replies

7. Shell Programming and Scripting

Users Not Logged in

I have searched the forums but have not mangaed to quite find what im looking for. I have used to /etc/passwd command to present me a list of all users the who command to present all users currently logged on, but what i want to know is what command can i use to display users that are registered... (12 Replies)
Discussion started by: warlock129
12 Replies

8. UNIX for Dummies Questions & Answers

How many users are logged in?

How do I find this out? I have a feeling its a simple command such as who, but I just don't know what it is. I've had a search on here but either I can't put it into the right search criteria or there isn't a topic on it. Thanks. EDIT: Delete this thread, as I posted it I noticed the... (0 Replies)
Discussion started by: chris_rabz
0 Replies

9. Shell Programming and Scripting

Total number of users logged in a server from uptime

how to find out total number of users logged in a server from uptime . i mean to say i need the total output of unix command . who gives the out put at a particular time . I need at all time from which machine who has connected , (3 Replies)
Discussion started by: amiya.te@gmail
3 Replies

10. Shell Programming and Scripting

Removing old user directories that are no longer Users in /etc/passwd

I am new to shell scripting, and have not done much programming in several years. So I am very rusty at this at best. I know my way around the linux command line, but actually scripting is something I have not done too much of. I have been tasked to come up with a script that will pull all... (5 Replies)
Discussion started by: shuiend
5 Replies
fwtmp(8)						      System Manager's Manual							  fwtmp(8)

NAME
fwtmp, acctwtmp, wtmpfix - Modify connect time accounting records to change formats and to make corrections in the records SYNOPSIS
fwtmp [-ic] acctwtmp 'Reason' wtmpfix [File . . .] FLAGS
The fwtmp command accepts ASCII records in the type utmp structure format as input. The fwtmp command converts output to type utmp struc- ture formatted binary records. The fwtmp command converts ASCII type utmp structure formatted input records to binary output records. DESCRIPTION
fwtmp [-ic] The fwtmp command reads records from standard input and writes records to standard output. Normally, information in record fields of the /var/adm/wtmp file is entered as binary data by the init and login programs during the life of the /var/adm/wtmp file. These /var/adm/wtmp file records have nine fields formatted according to members of a type utmp structure defined in the utmp.h include file. The fwtmp command is also capable of writing properly formatted ASCII records from standard input into a file when you use the -i flag. Whenever you enter properly formatted ASCII records for conversion to binary records using the -i flag from the standard input device, you must enter data for each field of the 9-field record in the same order as that of type utmp structure members using a space as a field sep- arator. The following table lists record fields in the order they should be entered, the type utmp structure member name, and the purpose and entry character length. The user login name, which must have exactly sizeof(ut_user) characters. The inittab ID, which must have exactly sizeof(ut_id) characters. The device name, which must have exactly sizeof(ut_line) characters. The process ID, which must have 5 decimal places. The type of entry, which must have 2 decimal places. The type of entry may have any one of several symbolic constant val- ues. The symbolic constants are defined in the utmp.h header file. The process termination status, which must have 4 decimal places. The process exit status, which must have 4 decimal places. The starting time, which must have 10 decimal places. The hostname, which must have exactly sizeof(ut_host) characters. All record field entries you make from standard input must be separated by a space. Also you must fill all string fields with blank charac- ters up to the maximum string size. All decimal values must have the specified number of decimal places with preceding 0s (zeros) to fill empty digit positions. The actual size of character arrays can be found in the utmp.h include file. acctwtmp 'Reason' The acctwtmp command is called by the runacct shell procedure to write a utmp formatted record to standard output with the current date and time together with a 'Reason' string (sizeof(ut_line) characters or less) that you must also enter. wtmpfix [File ...] The wtmpfix command is called by the runacct shell procedure to examine standard input or File records in the wtmp format for corrupted date and timestamp entries. Whenever a corrupted entry is detected, the wtmpfix command corrects date and timestamp inconsistencies and writes corrected records to standard output. Whenever the acctcon1 command runs, and a date and timestamp in a /var/adm/wtmp file is incor- rect, an error is generated when the first corrupted entry is encountered. The acctcon1 process is aborted whenever such an error is detected. The wtmpfix command also checks the validity of the name field to ensure that the name consists only of alphanumeric characters, a $ (dol- lar sign), or spaces. Whenever an invalid name is detected, the wtmpfix command changes the login name to INVALID and writes a diagnostic message to standard error. In this way, the wtmpfix command reduces the likelihood that the acctcon2 command may fail. Each time a date is entered (on system startup or with the date command) a pair of date-change records is written to the /var/adm/wtmp file. The first date-change record is the old date, which is entered with the string old time (the OTIME_MSG string) in the ut_line field and the flag OLD_TIME in the ut_type field. The second record is the new date, which is entered with the string new time (the NTIME_MSG string) in the ut_line field and the flag NEW_TIME in the ut_type field. The wtmpfix command uses these records to synchronize all date and time stamps in the /var/adm/wtmp file. The date-change record pair is then removed. RESTRICTIONS
You should not use the fwtmp command to correct connect-time accounting records because the utmp structure format members are not in the correct order for this operation. EXAMPLES
To convert binary /var/adm/wtmp records in type utmp structure format to an ASCII file called dummy.file, enter a command similar to the following: /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file The content of binary file /var/adm/wtmpfile as input is redirected to dummy.file as ASCII output. To convert records in an ASCII type utmp structure formatted file to a binary output file called /var/adm/wtmp, enter an fwtmp command with the -ic flag similar to the following: /usr/sbin/acct/fwtmp -ic < dummy.file > /var/adm/wtmp The content of ASCII file dummy.file as input is redirected to binary file /var/adm/wtmp as output. FILES
Specifies the command path. Specifies the command path. Specifies the command path. Header file defining structures used to organize login information. Database file for currently logged in users. Login/logout database file. RELATED INFORMATION
Commands: acct(8), acctcon(8), acctmerg(8), date(1), runacct(8) Functions: acct(2) delim off fwtmp(8)
All times are GMT -4. The time now is 07:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy