Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Apropos / Subsearch:
optional field

acctprc(8)							   acctprc(8)


  acctprc1, acctprc2, accton - Perform process-accounting procedures


  acctprc1 [InFile]


  accton [OutFile]


  The three acctprc commands, acctprc1,	acctprc2, and accton, are used in the
  runacct shell	procedure to produce process-accounting	reports.

  acctprc1 [InFile]

  The acctprc1 command is used to read records from standard input that	are
  in a format defined by the acct structure in the /usr/include/sys/acct.h
  header file.	This process adds the login names that correspond to user
  IDs, and then	writes corresponding ASCII records to standard output.	For
  each process,	the record format includes the following seven unheaded

  User ID
      The user ID column includes both traditional and assigned	user identif-
      ication numbers listed in	the /etc/passwd	file.

  Login	name
      The login	name is	the one	used for the user ID in	the /etc/passwd	file.

  Prime-time CPU time
      The number of seconds the	process	consumed when executed during prime-
      time hours. Prime-time and nonprime-time hours are defined in the
      /usr/sbin/acct/holidays file.

  Nonprime-time	CPU time
      The number of seconds the	process	consumed when executed during
      nonprime-time hours.

      Total number of characters transferred.

      Total number of blocks read and written.

      Mean memory size (in kilobyte units).

  When specified, InFile contains a list of login sessions in a	format
  defined by the utmp structure	in the /usr/include/utmp.h header file.	The
  login	session	records	are sorted according to	user ID	and login name.	When
  InFile is not	specified, acctprc1 gets login names from the password file
  /etc/passwd. The information in InFile is used to distinguish	different
  login	names that share the same user ID.


  The acctprc2 command reads, from standard input, the records written by
  acctprc1, summarizes them according to user ID and name, and writes sorted
  summaries to standard	output as total	accounting records in the tacct	for-
  mat (see the acctmerg	command).

  accton [OutFile]

  When no operands are specified with the accton command, account processing
  is turned off. When you specify an existing OutFile file, process account-
  ing is turned	on, and	the kernel adds	records	to that	file. You must
  specify an Outfile to	start process accounting. Many shell script pro-
  cedures expect the file name /var/adm/pacct, the standard process-
  accounting file.


   1.  To add a	user name to each process-accounting record in a binary	file
       and then	write these modified binary-file records to an ASCII file
       named out.file, enter the following line	to an accounting shell
	    /usr/sbin/acct/acctprc1  <&lt;	/var/adm/pacct	>&gt;out.file

       A user name is added to each record. The	raw data in the	pacct file is
       converted to ASCII and added to file out.file.

   2.  To produce a total binary accounting record of the ASCII	output file
       out.file	produced in example 1, enter the following line	to an
       accounting shell	script:
	    /usr/sbin/acct/acctprc2 <&lt; out.file >&gt; /var/adm/acct/nite/daytacct

       The resulting binary total accounting file, written in the acct for-
       mat, contains records sorted by user ID.	This sorted user ID file, is
       usually merged with other total accounting records when an acctmerg
       command is processed to produce a daily summary accounting record
       called /var/adm/acct/sum/daytacct.

   3.  To turn on process accounting, enter:
	    /usr/sbin/acct/accton /var/adm/pacct

   4.  To turn off process accounting, enter:


      Specifies	the command path.

      Specifies	the command path.

      Specifies	the command path.


  Commands: acct(8), acctcms(8), acctmerg(8), runacct(8)

  Functions: acct(2)