[cups.general] Restart PrintPro printers (CUPS) via command line

Michael R Sweet msweet at apple.com
Thu Feb 5 16:21:33 PST 2009


Matt wrote:
> We're having a problem with some printers in PrintPro periodically stopping for no known reason.
> 
> I have seen the following to restart the printer:
> 
> /usr/bin/enable printername

Yes, this is the right command.

> /usr/sbin/lpr restart

You probably mean "lpc restart", which isn't implemented by the CUPS
version of lpc.

> Really what I want to do is schedule something to find all stopped printers and restart them.  I don't want to stop/start printers that are already online.

Prior to CUPS 1.2, you can use a cron job to periodically enable all
printers, e.g.:

     #!/bin/sh
     for printer in `lpstat -p | grep printer | awk '{print $2}'`; do
         /usr/bin/enable $printer
     done

In CUPS 1.2 and higher, use the "retry-job" error policy to prevent the
queue from stopping.  Keep in mind that the jobs can get out of order
that way; CUPS 1.4 adds a "retry-current-job" error policy to prevent
that issue.

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups mailing list