Posted on 02-09-2009 10:25 AM
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.
Posted on 02-09-2009 10:31 AM
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
Posted on 02-09-2009 11:11 AM
well that works a treat. Course now I have paused queues for the printer :-)
Posted on 02-09-2009 11:41 AM
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
Posted on 02-09-2009 01:02 PM
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
Posted on 02-10-2009 05:54 AM
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
Posted on 12-15-2014 07:52 AM
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}'`