[cups] Monitoring concurrent print jobs

Johannes Meixner jsmeix at suse.de
Wed Jun 21 03:58:24 PDT 2023


Hello,

On 2023-06-20 21:19, Dave Close wrote:
> I hadn't looked at the cXXXXX job files
...
> they aren't easily searched using text-based tools
> as they contain binary field lengths instead of line endings.
> Time fields appear to be binary seconds since the epoch.
...
> I was hoping someone might have already produced a
> set of tools to deal with them.

there is the tool 'ipptool'.

In

https://github.com/OpenPrinting/cups/blob/master/examples/get-job-attributes2.test

I found an example how to 'Get-Job-Attributes'
with 'ipptool'.

I simplified it to this one
-------------------------------------------------------------
# cat /usr/share/cups/ipptool/get-job-attributes.test

{
         # The name of the test
         NAME "get-job-attributes"
         # The operation to use
         OPERATION Get-Job-Attributes
         # Attributes, starting in the operation group
         GROUP operation
         ATTR charset attributes-charset utf-8
         ATTR language attributes-natural-language en
         ATTR uri job-uri $uri
}
-------------------------------------------------------------

On my local system I have a completed print job
with job number 273 which has the 'job-uri'

ipp://localhost:631/jobs/273

To 'Get-Job-Attributes' with 'ipptool'
for the job with job number 273
one could call

# ipptool -tv ipp://localhost:631/jobs/273 get-job-attributes.test

which outputs a lot of values for that job
in human readable format, for example like
-------------------------------------------------------------
# ipptool -tv ipp://localhost:631/jobs/273 get-job-attributes.test | 
grep date

date-time-at-completed (dateTime) = 2023-06-14T09:06:10Z
date-time-at-creation (dateTime) = 2023-06-14T09:05:31Z
date-time-at-processing (dateTime) = 2023-06-14T09:06:07Z
-------------------------------------------------------------


By the way,
some additional info which I found:

https://openprinting.github.io/cups/doc/spec-design.html
reads
----------------------------------------------------------
control files starting with the letter "c" ("c00001", ...
...
Control files are IPP messages based on the original
IPP Print-Job or Create-Job messages
----------------------------------------------------------
so one would need a tool that converts IPP messages
into human readable text and by "googling" I found

https://stackoverflow.com/questions/53688075/how-to-dissect-a-cups-job-control-file-var-spool-cups-cnnnnnn

which was asked 4 years, 6 months ago and talks about 'testipp'.

As far as I see 'testipp' is only used while CUPS is compiled
for tests during CUPS compile time so it seems 'testipp'
is not meant to be used as an end user program.


Kind Regards
Johannes Meixner
-- 
SUSE Software Solutions Germany GmbH
Frankenstr. 146 - 90461 Nuernberg - Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
(HRB 36809, AG Nuernberg)


More information about the cups mailing list