printing a job

Kurt Pfeifle k1pfeifle at gmx.net
Mon Aug 27 17:03:47 PDT 2007


Mohammad wrote:

> Knowing the number of pages after jobs are done is fine too. Is there any 
> way to find it on command line?

As I said -- no easy, direct way. No 'official' way either...

But you can use the 'testipp' utility; this is probably not part of
the CUPS package provided by your distro -- you need to compile CUPS
yourself and get it from there (it will be built in the 'cups' sub-
directory).

Then you can do (as root)

  /path/to/testipp /var/spool/cups/c00123

to see the IPP job attributes of job-id '123'. (You need to be root
because a normal user can't read the /var/spool/cups/ directory....)

The attribute 'job-media-sheets-completed' is the number of printed
pages for that job. (If you print 4 copies of a 5-page document, you
will see '20').

  /path/to/testipp /var/spool/cups/c00123 | grep job-media-sheets-completed

CUPS does only count pages for jobs which are not printed as "raw".
For raw jobs, it will always count '1' page.


>> Mohammad wrote:
>>> Awesome. Thank you very much.
>>>
>>> Do you know how I can figure out how many pages were printed?
>> There is no easy, direct way to get the number of pages printed on
>> the commandline.
>>
>> As for the web interface -- that will only tell the number of pages
>> *after* the job is finished (i.e. not during the 'hold' state).
>>
>> If you need sophisticated print accounting for CUPS, then have a
>> look at www.pykota.com
>>
>>> Even in cups
>>> web interface it's written unknown in page number entry.
>>>
>>>
>>>> Mohammad wrote:
>>>>
>>>>> I have set up cups on my computer and it's working fine. I have change
>>>>> its setting so that it holds all print jobs coming to it.
>>>>>
>>>>> I can see all held jobs on CUPS web interface, but I would like to do
>>>>> that using command line. I would be glad if you let me know how I can
>>>>> print each job.
>>>>>
>>>>> I have tried lp -i job-id with no luck.
>>>> # list all held jobs from all queues:
>>>>    lpstat -o
>>>>
>>>> # list jobs from a specific queue:
>>>>    lpstat -o queuename
>>>>
>>>> # release a held job:
>>>>    lp -i jobid -H resume


-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list