qcan Command

Purpose

Cancels a print job.

Syntax

qcan [ -X ] [ -x JobNumber ] [ -P Printer ]

Description

The qcan command cancels either a particular job number or all jobs in a print queue.

You could also use the System Management Interface Tool (SMIT) smit qcan fast path to run this command.

The qstatus was enhanced to improve the administration of local queues showing duplicate 3-digit job numbers. You can use the -W flag with the enq, qchk, lpstat, and lpq status commands to display more job number digits.

If your queue display shows duplicate 3-digit job numbers, use qchk -W to list job numbers with greater precision. You can then cancel a specific job.

For example, qchk might display job number 123 twice while, qchk -W would display job number 1123 and 2123. If you want to cancel job number 2123, specifying qcan -x 123, causes the qdaemon to cancel the first matching job number it finds in its internal list, which may be 1123. By having the additional information that the -W flag provides, you can cancel a specific job number.

Flags

Item Description
-P Printer Specifies the Printer where either all jobs or the selected job number will be canceled.
-x JobNumber Specifies that only the job number specified by the JobNumber variable be canceled.
-X Cancels all jobs or all jobs for the specified printer. If you have root user authority, all jobs on that queue are deleted. If you do not have root user authority, only jobs you submitted will be canceled. This flag is only valid for local print jobs.

Security

Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To cancel all jobs queued on printer lp0, enter:
    qcan  -X  -P lp0
  2. To cancel job number 123 on whatever printer the job is on, enter:
    qcan  -x 123

Files

Item Description
/usr/sbin/qdaemon Contains the qdaemon daemon.
/var/spool/lpd/qdir/* Contains the job description files.
/var/spool/lpd/stat/* Contains information on the status of the devices.
/var/spool/qdaemon/* Contains the temporary copies of enqueued files.
/etc/qconfig Contains the configuration file.
/etc/qconfig.bin Contains the digested, binary version of the /etc/qconfig file.