2 <!-- SECTION: Getting Started -->
4 <TITLE>Printer Accounting Basics
</TITLE>
5 <LINK REL=
"STYLESHEET" TYPE=
"text/css" HREF=
"../cups-printable.css">
9 <H1 CLASS=
"title">Printer Accounting Basics
</H1>
11 <P>CUPS supports a variety of printer accounting schemes. Aside from the
12 built-in
<A HREF=
"#QUOTAS">quota
</A> and
<A HREF=
"#PAGELOG">page logging
</A>
13 support, there are several third-party solutions that can be found online.
</P>
16 <H2 CLASS=
"title"><A NAME=
"QUOTAS">Quota Support
</A></H2>
18 <P>CUPS supports page and size-based quotas for each printer.
19 The quotas are tracked individually for each user, but a single set of
20 limits applies to all users for a particular printer. For example, you
21 can limit every user to
5 pages per day on an expensive printer, but
22 you cannot limit every user except Johnny.
</P>
24 <P>The
<CODE>job-k-limit
</CODE>,
<CODE>job-page-limit
</CODE>, and
<CODE>job-quota-period
</CODE>
25 options determine whether and how quotas are enforced for a printer.
26 The
<CODE>job-quota-period
</CODE> option determines the time interval for
27 quota tracking. The interval is expressed in seconds, so a day is
28 86,
400, a week is
604,
800, and a month is
2,
592,
000 seconds. The
29 <CODE>job-k-limit
</CODE> option specifies the job size limit in kilobytes. The
30 <CODE>job-page-limit
</CODE> option specifies the number of pages limit.
</P>
32 <P>For quotas to be enforced, the period and at least one of the limits
33 must be set to a non-zero value. The following options will enable
34 weekly quotas with the given size and page count limits:
</P>
37 <KBD>/usr/sbin/lpadmin -p
<I>printer
</I> -o job-quota-period=
604800 \
38 -o job-k-limit=
1024 ENTER
</KBD>
39 <KBD>/usr/sbin/lpadmin -p
<I>printer
</I> -o job-quota-period=
604800 \
40 -o job-page-limit=
100 ENTER
</KBD>
43 <P>Or, you can combine all three options on the same line.
</P>
45 <P>While there is no way to query the current quota state for a particular
46 user, any application can request a list of jobs for a user and printer that
47 can be used to easily determine that information.
</P>
50 <H2 CLASS=
"title"><A NAME=
"PAGELOG">Page Logging
</A></H2>
52 <P>CUPS can log every page that is printed on a system to the
<VAR><A HREF=
"man-cupsd-logs.html">page_log
</A></VAR> file. Page logging must be enabled by setting the
<CODE>PageLogFormat
</CODE> directive in the
<VAR><A HREF=
"man-cupsd.conf.html">cupsd.conf
</A></VAR> file and is only available for drivers that provide page accounting information, typically all PostScript and CUPS raster devices. Raw queues and queues using third-party solutions such as Foomatic generally do not have useful page accounting information available.
</P>