Re: Printers

 
SOLVED
Go to solution
Feljav
Frequent Advisor

Printers

How can I remove all jobs in the print queue?
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Printers

Use the cancel command.
If it ain't broke, I can fix that.
Feljav
Frequent Advisor

Re: Printers

Cancel command only remove one job in the queue. Are there another command?
Dennis Handly
Acclaimed Contributor
Solution

Re: Printers

>Cancel command only remove one job in the queue.

cancel(1) says you can use -e to empty the queue on each dest:
# cancel dest -e
A. Clay Stephenson
Acclaimed Contributor

Re: Printers

... and even on those flavors of UNIX that don't support cancel -e, it is trivially easy to write a script that captures the output of lpstat and then issues a cancel command for each job.
If it ain't broke, I can fix that.
Rory R Hammond
Trusted Contributor

Re: Printers

At times I have found that cancel the whole
queue at once has hung the spooler, stopping all print jobs for an extended time. I preferred canceling one a time.

Want to cancel reportprinter jobs

for arg in $(lpstat -oreportprinter |grep priority|cut -f1 -d" ")
do
cancel ${arg}
done
There are a 100 ways to do things and 97 of them are right