How do I clear all jobs from a print queue on AIX 7.2?
The fix
Problem: A print queue on AIX 7.2 (standard qdaemon print subsystem, not CUPS) has a backlog of jobs to remove.
Fix: Cancel every job on the queue with qcan -X -P <queue>, run as root or a member of the printq group. Run as an ordinary user, -X removes only that user's own jobs.
Verify: lpstat -W (or qchk -P <queue>) shows no jobs left on the queue.
Applies to: AIX 7.2 with the standard AIX print spooler (qdaemon).
The full conversation
The original back-and-forth with Claude that led to the fix above.
I'm on AIX 7.2 and use the standard AIX print subsystem (qdaemon), not CUPS. A print queue has jobs piled up and I need to clear them all out. What's the best way?
The standard AIX spooler has a command for this: qcan. Its -X flag cancels every job on the queue you name with -P.
List what's queued:
(
qchk -Ashows the same thing.)Cancel every job on the queue:
Run this as root or as a member of the
printqgroup so it removes every user's jobs. Run as an ordinary user,-Xremoves only your own jobs.To cancel a single job instead:
Check that the queue is empty:
If the queue shows as DOWN afterwards, bring it back up with qadm -U <queue> (or enable <queue>).
qcan -X -P <queue> cleared it out.
Something wrong with this fix? Report it