1*5e7646d2SAndroid Build Coastguard Worker<HTML> 2*5e7646d2SAndroid Build Coastguard Worker<!-- SECTION: Getting Started --> 3*5e7646d2SAndroid Build Coastguard Worker<HEAD> 4*5e7646d2SAndroid Build Coastguard Worker <TITLE>Printer Accounting Basics</TITLE> 5*5e7646d2SAndroid Build Coastguard Worker <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css"> 6*5e7646d2SAndroid Build Coastguard Worker</HEAD> 7*5e7646d2SAndroid Build Coastguard Worker<BODY> 8*5e7646d2SAndroid Build Coastguard Worker 9*5e7646d2SAndroid Build Coastguard Worker<H1 CLASS="title">Printer Accounting Basics</H1> 10*5e7646d2SAndroid Build Coastguard Worker 11*5e7646d2SAndroid Build Coastguard Worker<P>CUPS supports a variety of printer accounting schemes. Aside from the 12*5e7646d2SAndroid Build Coastguard Workerbuilt-in <A HREF="#QUOTAS">quota</A> and <A HREF="#PAGELOG">page logging</A> 13*5e7646d2SAndroid Build Coastguard Workersupport, there are several third-party solutions that can be found online.</P> 14*5e7646d2SAndroid Build Coastguard Worker 15*5e7646d2SAndroid Build Coastguard Worker 16*5e7646d2SAndroid Build Coastguard Worker<H2 CLASS="title"><A NAME="QUOTAS">Quota Support</A></H2> 17*5e7646d2SAndroid Build Coastguard Worker 18*5e7646d2SAndroid Build Coastguard Worker<P>CUPS supports page and size-based quotas for each printer. 19*5e7646d2SAndroid Build Coastguard WorkerThe quotas are tracked individually for each user, but a single set of 20*5e7646d2SAndroid Build Coastguard Workerlimits applies to all users for a particular printer. For example, you 21*5e7646d2SAndroid Build Coastguard Workercan limit every user to 5 pages per day on an expensive printer, but 22*5e7646d2SAndroid Build Coastguard Workeryou cannot limit every user except Johnny.</P> 23*5e7646d2SAndroid Build Coastguard Worker 24*5e7646d2SAndroid Build Coastguard Worker<P>The <CODE>job-k-limit</CODE>, <CODE>job-page-limit</CODE>, and <CODE>job-quota-period</CODE> 25*5e7646d2SAndroid Build Coastguard Workeroptions determine whether and how quotas are enforced for a printer. 26*5e7646d2SAndroid Build Coastguard WorkerThe <CODE>job-quota-period</CODE> option determines the time interval for 27*5e7646d2SAndroid Build Coastguard Workerquota tracking. The interval is expressed in seconds, so a day is 28*5e7646d2SAndroid Build Coastguard Worker86,400, a week is 604,800, and a month is 2,592,000 seconds. The 29*5e7646d2SAndroid Build Coastguard Worker<CODE>job-k-limit</CODE> option specifies the job size limit in kilobytes. The 30*5e7646d2SAndroid Build Coastguard Worker<CODE>job-page-limit</CODE> option specifies the number of pages limit.</P> 31*5e7646d2SAndroid Build Coastguard Worker 32*5e7646d2SAndroid Build Coastguard Worker<P>For quotas to be enforced, the period and at least one of the limits 33*5e7646d2SAndroid Build Coastguard Workermust be set to a non-zero value. The following options will enable 34*5e7646d2SAndroid Build Coastguard Workerweekly quotas with the given size and page count limits:</P> 35*5e7646d2SAndroid Build Coastguard Worker 36*5e7646d2SAndroid Build Coastguard Worker<PRE CLASS="command"> 37*5e7646d2SAndroid Build Coastguard Worker<KBD>/usr/sbin/lpadmin -p <I>printer</I> -o job-quota-period=604800 \ 38*5e7646d2SAndroid Build Coastguard Worker -o job-k-limit=1024 ENTER</KBD> 39*5e7646d2SAndroid Build Coastguard Worker<KBD>/usr/sbin/lpadmin -p <I>printer</I> -o job-quota-period=604800 \ 40*5e7646d2SAndroid Build Coastguard Worker -o job-page-limit=100 ENTER</KBD> 41*5e7646d2SAndroid Build Coastguard Worker</PRE> 42*5e7646d2SAndroid Build Coastguard Worker 43*5e7646d2SAndroid Build Coastguard Worker<P>Or, you can combine all three options on the same line.</P> 44*5e7646d2SAndroid Build Coastguard Worker 45*5e7646d2SAndroid Build Coastguard Worker<P>While there is no way to query the current quota state for a particular 46*5e7646d2SAndroid Build Coastguard Workeruser, any application can request a list of jobs for a user and printer that 47*5e7646d2SAndroid Build Coastguard Workercan be used to easily determine that information.</P> 48*5e7646d2SAndroid Build Coastguard Worker 49*5e7646d2SAndroid Build Coastguard Worker 50*5e7646d2SAndroid Build Coastguard Worker<H2 CLASS="title"><A NAME="PAGELOG">Page Logging</A></H2> 51*5e7646d2SAndroid Build Coastguard Worker 52*5e7646d2SAndroid Build Coastguard Worker<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> 53*5e7646d2SAndroid Build Coastguard Worker 54*5e7646d2SAndroid Build Coastguard Worker</BODY> 55*5e7646d2SAndroid Build Coastguard Worker</HTML> 56