Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using command line to cancel all jobs for a remote printer

0 views
Skip to first unread message

james_s...@my-deja.com

unread,
Dec 20, 2000, 1:33:56 AM12/20/00
to
I am stuck (again)

I am using a script to cancel all jobs in a virtual printer queue.

I have found the command cancel but I need to supply the request-id for
each job in the queue.

using

cancel printer

will only cancel currently printing jobs - if the queue is disabled
then the jobs are not printing and no jobs are cancelled.

How can I use the command line to cancel all existing jobs for a given
printer?

Any useful suggestions grteatly appreciated.

James


Sent via Deja.com
http://www.deja.com/

Tom Parsons

unread,
Dec 20, 2000, 6:10:45 AM12/20/00
to sco...@xenitec.on.ca
james_s...@my-deja.com enscribed:

You didn't mention what product you have which can make a difference.

You said command line, in which instance, "scoadmin print job manager"
is the logical answer.

Then you said from a script, which would indicate you should read the
man page for lpstat because background information is always helpful.

I can't decide if this is homework so I'll give the logic and we'll
critique your efforts. :-)
run lpstat -o to get a list of all pending print jobs
use awk or other tool to get just those you need
invert the list (bonus points for guessing why you do this)
loop though the list, cancelling each one.

--
==========================================================================
Tom Parsons t...@tegan.com
==========================================================================

Igor Istlentiev

unread,
Dec 20, 2000, 6:42:24 AM12/20/00
to
Hi!

Try:

-- cut --
for job in `lpstat -o your_printer | awk '{print $1}'` ; do
cancel $job
done
-- cut --

--
Best regards,
Igor Istlentiev
Voronezh Savings Bank

Jean-Pierre Radley

unread,
Dec 20, 2000, 10:45:43 AM12/20/00
to ScoMisc [c.u.s.m]
Tom Parsons propounded (on Wed, Dec 20, 2000 at 11:10:45AM +0000):
| james_s...@my-deja.com enscribed:

| |
| | I am using a script to cancel all jobs in a virtual printer queue.
| |
| | I have found the command cancel but I need to supply the request-id for
| | each job in the queue.
|
| You didn't mention what product you have which can make a difference.
|
| You said command line, in which instance, "scoadmin print job manager"
| is the logical answer.
|
| Then you said from a script, which would indicate you should read the
| man page for lpstat because background information is always helpful.
|
| I can't decide if this is homework so I'll give the logic and we'll
| critique your efforts. :-)
| run lpstat -o to get a list of all pending print jobs
| use awk or other tool to get just those you need
| invert the list (bonus points for guessing why you do this)
| loop though the list, cancelling each one.

There's a TA for this, 103239, first issued in 1991.

--
JP

Tom Parsons

unread,
Dec 20, 2000, 3:28:39 PM12/20/00
to sco...@xenitec.on.ca
Jean-Pierre Radley enscribed:

It doesn't kill in LIFO order so as each job is killed, the next one tries
to get to the printer, creating unnecessary thrashing and sometimes
undesirable results.

0 new messages