[cups] How to call a script when a job arrives

Johannes Meixner jsmeix at suse.de
Fri Apr 5 02:08:24 PDT 2019


Hello,

On Apr 5 10:11 Marc Haber wrote:
> I have a network printer that can be turned on by doing a certain curl
> call, and would like CUPS to turn the printer on automatically when a
> print job for this printer arrives.
>
> Must I do this in a filter or is there a more elegant place for this?
> How and where would I specify a filter that is used for all jobs for a
> certain printer?

Strictly speaking it should be a CUPS backend that does all what
is needed to send the final printer data to the printer device
but because ther can be only one backend run for a print job
one would need a wrapper backend that does the curl call and
then call the actual backend from the wrapper backend
so that it is probably easier to do it with a filter
by using the DEVICE_URI environment variable in the filter
to get the info how to access the right printer device.

For general info you may have a look at
https://en.opensuse.org/SDB:CUPS_in_a_Nutshell
and for more specific info you may have a look at
https://en.opensuse.org/SDB:Using_Your_Own_Backends_to_Print_with_CUPS
and
https://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS

That articles are somewhat old so that this or that detail
may have changed but in general it should still apply.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX GmbH - HRB 21284 (AG Nuernberg)
GF: Felix Imendoerffer, Mary Higgins, Sri Rasiah



More information about the cups mailing list