cancel Command

Purpose

Cancels requests to a line printer.

Syntax

cancel { JobID ... | PrinterName }

or

cancel JobID QueueName

Description

The cancel command cancels line printer requests that were made by the lp command.

Specifying the following cancels the local print jobs:

In AIX® 4.3.2 and above, 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 cancel 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.

And for remote print jobs, both the JobID and remote QueueName must be specified in order to explicitly cancel a job on a remote queue.

Notes:
  1. You must have root-user authority, or be a member of the print group, to cancel print requests that were not submitted by your current ID.
  2. The JobID must be a number.
  3. If you enter cancel -?, the system displays the following error message:
    enq: (FATAL ERROR): 0781-048: Bad queue or device name: -?

Exit Status

This command returns the following exit values:

Item Description
0 Successful completion.
>0 An error occurred.

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.

Files

Item Description
/var/spool/qdaemon/* Contains temporary copies of enqueued files.
/var/spool/lpd/qdir/* Contains job description files for print jobs.
/usr/bin/cancel Contains the command file.

Purpose

Cancel print requests

Syntax

cancel [request-IDs] [printers]

cancel -u login-IDs [printers]

Description

The cancel command allows users to cancel print requests previously sent with the lp command. The first form of cancel permits cancellation of requests based on their request-ID. The second form of cancel permits cancellation of requests based on the login-ID of their owner.

Canceling a print request

The cancel command cancels requests for print jobs made with the lp command. The first form allows a user to specify one or more request-IDs of print jobs to be canceled. Alternatively, the user can specify one or more printers, on which only the currently printing job will be canceled if it is the user's job.

The second form of cancel cancels all jobs for users specified in login-IDs. In this form the printers option can be used to restrict the printers on which the users' jobs will be canceled. Note that in this form, when the printers option is used, all jobs queued by the users for those printers will be canceled. A printer class is not a valid argument.

A user without special privileges can cancel only requests that are associated with his or her own login ID; To cancel a request, a user issues the command:
cancel -u login-ID [printer]

This command cancels all print requests associated with the login-ID of the user making the request, either on all printers (by default) or on the printer specified.

Administrative users with the appropriate privileges can cancel jobs submitted by any user by issuing the following types of commands:

cancel -u “login-ID-list
Cancels all requests (on all relevant printers) by the specified users, including those jobs currently being printed. Double quotes must be used around login-ID-list if the list contains blanks. The argument login-ID-list may include any or all of the following constructs:
login-ID
a user on the local system
system-name!login-ID
a user on system system-name
system-name!all
all users on system system-name
all!login-ID
a user on all systems
all
all users on the local system
all!all
all users on all systems

A remote job can be canceled only if it originated on the client system; that is, a server system can cancel jobs that came from a client, and a client system can cancel jobs it sent to a server.

cancel -u “login-ID-list printer-1 printer-2 printer-n
Cancels all requests by the specified users for the specified printers, including those jobs currently being printed. (For a complete list of printers available on your system, execute the lpstat -p command.)

In any of these cases, the cancellation of a request that is currently printing frees the printer to print the next request.

Security

RBAC Environment

This command implements and can perform privileged operations. Only privileged users can run such privileged operations. For more information about authorizations and privileges, refer to the RBAC section: Privileged Command Database in AIX Version 7.1 Security. To review the list of privileges and the authorizations associated with this command, refer to the /etc/security/privcmds database.