When printing a job to a CUPS server, you can set up the cupsd.conf parameters PreserveJobHistory
and PreserveJobFiles
to control how many jobs you want to keep.
CUPS always temporarily stores the actual print job files in directory /var/spool/cups/
. The spool files as submitted by the print client (before CUPS' conversion chain of filters kicks in) are always named dNNNNNN-001 (starting with a 'd' as in 'datafile') where NNNNNN is the job ID assigned by CUPS. If you submit a multi-document print job, the second document's spool file within the same job ID is named dNNNNNN-002, and so on...
Also, the same directory will hold files starting with another character, the control files and they will be named cNNNNNN for each job.
I want to dissect these control files files.
When I use the strings
tool, it only reveals part of what I want to get at:
Example:
sudo strings /var/spool/cups/d00089
attributes-charset
utf-8H
attributes-natural-language
en-us
printer-uri
%ipp://localhost:631/printers/hp2B
job-originating-user-name
kurtpfeifleB
job-name
hosts!
copies
finishings
job-cancel-after
job-hold-until
no-hold!
job-priority
job-sheets
noneB
none!
number-up
job-uuid
-urn:uuid:ca854775-f721-34a5-57e0-b38b8fb0f4c8B
job-originating-host-name
localhost!
time-at-creation
time-at-processing
time-at-completed
job-id
job-state
job-state-reasons
processing-to-stop-point!
job-media-sheets-completed
job-printer-uri
(ipp://host13.local:631/printers/hp!
job-k-octets
document-format
text/plainA
job-printer-state-message
job-printer-state-reasons
none
Also, that strings
output doesn't look very nice.
Question: Is there a programmatic (or other) way to dissect these CUPS job control files and get at their complete content with all included info?