Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ac(8) [netbsd man page]

AC(8)							    BSD System Manager's Manual 						     AC(8)

ac -- display connect time accounting SYNOPSIS
ac [-d | -p] [-t tty] [-w file] [users ...] DESCRIPTION
If the file /var/log/wtmp exists, a record of individual login and logout times are written to it by login(1) and init(8), respectively. The program ac examines these records and writes the accumulated connect time for all logins to the standard output. Options available: -d Display the connect times in 24 hour chunks. -p Display individual user totals. -t tty Only do accounting logins on certain ttys. The tty specification can start with '!' to indicate not this tty and end with '*' to indicate all similarly named ttys. Multiple -t flags may be specified. -w file Read raw connect time data from file instead of the default file /var/log/wtmp. users ... Display totals for the given individuals only. If no arguments are given, ac displays the total amount of login time for all active accounts on the system. The default wtmp file is an infinitely increasing file unless frequently truncated. This is normally done by the daily daemon scripts sched- uled by cron(8), which rename and rotate the wtmp files before truncating them (and keep about a week's worth on hand). No login times are collected, however, if the file does not exist. For example, ac -p -t "ttyd*" > modems ac -p -t "!ttyd*" > other allows times recorded in modems to be charged out at a different rate than other. The ac utility exits 0 on success, and >0 if a fatal error occurs. FILES
/var/log/wtmp connect time accounting file /var/log/wtmp.[0-7] rotated files SEE ALSO
login(1), utmp(5), init(8), sa(8) HISTORY
An ac command appeared in Version 6 AT&T UNIX. This version of ac was written for NetBSD 1.0 from the specification provided by various sys- tems' manual pages. BSD
April 19, 1994 BSD

Check Out this Related Man Page

ac(8)							      System Manager's Manual							     ac(8)

ac - Outputs connect-session records SYNOPSIS
ac [-dp] [-w filename] [user(s) ...] FLAGS
Outputs the total connect time for each midnight-to-midnight period for which a wtmp file exists. When user(s) is specified, this flag lim- its the output to the login names specified by any user(s) parameter(s). Outputs the connect time total by individual login name of the user specified with the -p flag and the user(s) parameter. Omission of this flag permits a total only for the midnight-to-midnight time period for all logged in users to be produced. Specifies a wtmp file other than the /var/adm/wtmp file. The wtmp file you access for data may have been created automatically by some shell script administration command (for example, runacct) or manually by the system adminis- trator when the original /var/adm/wtmp file becomes too large. DESCRIPTION
The ac command prints to the default output device the total connect time in hours to the nearest hundredth for all users, or the connect time for any user(s) specified with the -p flag. It also prints the names of users specified by the user(s) parameter who have logged in during the life of the current /var/adm/wtmp file. Connect-time records are written by the init and the login programs and are collected in the /var/adm/wtmp file, when such a file exists. When a /var/adm/wtmp file does not exist, no connect-time accounting records are written; consequently, when connect-time records are wanted, the system administrator should create a /var/adm/wtmp file that has an initial record length of 0 (zero). Records in wtmp files (there may be more than one such file) should be processed periodically to keep the files from becoming too large. When you use the runacct command in a shell script, additional wtmp files can be automatically created whenever the current wtmp file becomes too large. You can output the contents of any of these other files when you specify the -w flag and the desired wtmp filename. The ac command is run independently with respect to any accounting shell procedure created or run by any of the acct/* shell procedures or runacct commands. EXAMPLES
To obtain an output of the total connect time for all users who have logged in during the life of the current wtmp data file, enter: /usr/sbin/ac To obtain an output of the total connect time for grossman and mcwhinney as recorded in the default wtmp data file, enter: /usr/sbin/ac grossman mcwhinney To obtain an output of the connect time subtotals for grossman and mcwhinney as recorded in the default wtmp data file, enter: /usr/sbin/ac -p grossman mcwhinney FILES
Specifies the command path. Is the active data file for the collection of connect-time records. RELATED INFORMATION
Commands: login(1), init(8) delim off ac(8)
Man Page