Run command before and after printing with CUPS?

Posted by leto on Server Fault See other posts from Server Fault or by leto
Published on 2010-12-02T10:57:03Z Indexed on 2010/12/26 12:56 UTC
Read the original article Hit count: 239

Filed under:
|
|
|
|

Hello, 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!

© Server Fault or respective owner

Related posts about bash

Related posts about script