How do I clear all jobs from a print queue on AIX 7.2?

aixaix-7.2print-queueprintingqcanqdaemon Solved with Claude Shared by Tom

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.

Question

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?

Claude

The standard AIX spooler has a command for this: qcan. Its -X flag cancels every job on the queue you name with -P.

  1. List what's queued:

    bash
    lpstat -W

    (qchk -A shows the same thing.)

  2. Cancel every job on the queue:

    bash
    qcan -X -P <queue>

    Run this as root or as a member of the printq group so it removes every user's jobs. Run as an ordinary user, -X removes only your own jobs.

    To cancel a single job instead:

    bash
    qcan -x <jobnumber>
  3. Check that the queue is empty:

    bash
    lpstat -W

If the queue shows as DOWN afterwards, bring it back up with qadm -U <queue> (or enable <queue>).

Question

qcan -X -P <queue> cleared it out.