printing a job
Mohammad
momoir at gmail.com
Wed Sep 12 09:41:04 PDT 2007
Hi,
I tried to switch to lprng in order to obtain number of pages for a print job, but I had no luck with it, so I switched back to cups again.
This time I installed it from source instead of installing from apt-get.
After successful installation of CUPS I made sure that everything is fine with printing.
Then, I went to test/ subdirectory inside cups main directory and I found ipptest there. I believe ipptest should be the same as testipp as mentioned by Kurt previously. Then, I issued the following command to obtain number of pages for give print job.
./ipptest -v /var/spool/cups/c00046 | grep job-media-sheets-completed
which returned:
Unable to connect to on port 0 - No such file or directory
Usage: ipptest [options] URL testfile [ ... testfileN ]
Options:
-i N Repeat the last test file once every N seconds.
-v Show all attributes in response, even on success.
I would like to mention that c00046 is a completed print job.
Any idea what's wrong?
> 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