this is a home setup. A central printer server (Linux) manages the queue, a HP 2430DTN is attached to it via 100Mbit/sec Ethernet. The printer is hooked up to a managable power source. A shell script watches the queue on the server (lpstat -o) and turn on the printer when there is a job. If the queue is empty for 10 minutes it turns the printer off.

Now this setup messes up, stops the printer etc. after a couple of weeks and is in general "not so reliable". I now know how to change the stop-printer thing, but:

Is there a way to run my turn printer on script and turn printer off script directly from cups without watching the queue? That would be so cool!

closed as off-topic by Sven Nov 7 '16 at 20:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Sven
If this question can be reworded to fit the rules in the help center, please edit the question.


My suggestion is to use tea4cups.

tea4cups serves as a generic wrapper around any standard CUPS backend. It allows you to configure any command to run before and after sending the job off via the real backend.

tea4cups specifically allows (any number of) commands to be run before the job is sent off: prehooks. A prehook command which exits -1 can cancel the job.

tea4cups also allows (any number of) commands to be run after the job is sent off: posthooks (unless a prehook with exit -1 cancelled the job).

Prehooks can send data to the posthooks through pipes.

tea4cups can also run filters (which may modify the print data before sending them off to the real printer through the real backend).

From now on, only your own creativity is a limit to what you can do with this framework.

  • Tea4Cups seem to be dead. Is there any successor or equivalent free software system, @kurt-pfeifle? – lfd May 14 '18 at 16:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.