Stuck print queues

Eyoung
Contributor

anyone figure out a way to clear local print queues en mass?

Having an issue where a lab full of machines will all stop printing when one or more stations sends a bad job. These are local queues managed by WGM. Right now, I am hitting every machine individually to clear stuck jobs.

It seems to me there should be a way to blast a script or some such, that clears a specific print queue for a whole lab.

any clues would be greatly appreciated.

6 REPLIES 6

dustydorey
Contributor III

cancel -a -

in unix should do it. Put it in a shell script or run it in a policy
or whatever.

-Dusty-

Dustin Dorey

Technology Support Cluster Specialist

ISD 196 Apple Valley, Eagan, Rosemount

dustin.dorey at district196.org

952|423|7971

Eyoung
Contributor

well that works a treat. Course now I have paused queues for the printer :-)

Eyoung
Contributor

Upon further digging it seems that 10.5 does not have the enable command in its /usr/bin. Odd that part of the tools set would be there (cancel -a -) but not the rest.

~~~~~~~~~~
A cynic is a man who, when he smells flowers, looks around for a coffin. --H. L. Mencken

Eric Young
eyoung at thayer.org

Not applicable

Part of the problem is that in Leopard the default job fail procedure is to pause the printer. Now that you need admin privs to unpause the printer, this can be bothersome.

I've got a script that runs at login the ensures the correct printer is default, and I added this section to the end to change the default error-policy on all printers to abort job. This has really reduced the calls we get from labs saying the printers are paused.

#!/bin/bash

printers=lpstat -a | awk '{print $1}'
for printer in $printers
do echo "Changing error policy on $printer" lpadmin -p "$printer" -o printer-error-policy=abort-job
done

exit

Hope it helps.

Ryan Harter
UW - Stevens Point
Workstation Developer
715.346.2716
Ryan.Harter at uwsp.edu

Eyoung
Contributor

hmm. The script errors out with command not found.... These are local print queues that were setup via WGM. ... not sure if lpadmin is applicable.

echo Changing error policy on Color_next_to_me_IPP: command not found

------------------------------------------------
I'm living so far beyond my income that we may almost be said to be living apart. - ee cummings

Eric Young
eyoung at thayer.org

Smiles
New Contributor

Try this in self help as a script. Basically this just clears every print job and then reenables the printer for every printer that currently has a status of disabled.

sudo /usr/sbin/cupsenable -c `/usr/bin/lpstat -p | /usr/bin/grep disabled | /usr/bin/awk '{print $2}'`

Non full path version is:

sudo cupsenable -c `lpstat -p | grep disabled | awk '{print $2}'`