'action' when a print job is received

Peter Honegger honegger at legends.ch
Thu Nov 23 06:47:26 PST 2006


> On Thu, Nov 23, 2006 at 03:17:42AM -0500, Peter Honegger wrote:
> >
> > Is there a way to execute a shell script when cups is receiving a
> > print job (and perhaps again after the job is suceeded)?
>
> Yes with CUPS 1.2.x
>
> You can use the notification/subscription system.
>
> See CUPS' documentation for details and for the list
> of events you can subscribe your script to.
>
Hi Jerome

Thanks for you answer! I've put this in /etc/cups/subscriptions.conf and it's working!

<Subscription 1>
Events job-created
Owner lp
Recipient schalter_1_on
PrinterName Samsung_Windows
</Subscription>
<Subscription 1>
Events job-completed
Owner lp
Recipient schalter_1_off
PrinterName Samsung_Windows
</Subscription>

"schalter_1_*" are my power-on/off scripts for the printer, they must be in /usr/lib/cups/notifier.

The man page could contain a example - had to figure this out with a lot of try and errors. Due the lack of Python knowledge I've decied not to use pkipplib.


Thanks anyway,
Peter





More information about the cups mailing list