Home / Alt manpages / cupsreject(8)

  • cupsreject(8)
  • Admin command
  • linux

Stop New Print Jobs Safely with cupsreject

Use cupsreject to make a CUPS printer or printer class refuse new jobs while leaving existing queue entries alone. You will set a visible reason, check the result with lpstat, and restore acceptance with cupsaccept when the interruption is over.

This guide takes about five minutes once you know the destination name. It applies to the cups-client package version 2.4.7-1.2ubuntu7.14 installed on this system. You need a working CUPS scheduler, the name of a configured printer or class, and permission to change its job-acceptance state. The command may request authentication according to the server policy.

Checkpoint: identify the destination

First, list printers and their current state. This is a read-only check, so it is safe to run before deciding whether to reject jobs.

lpstat -p -d

Look for a line such as printer office_bw .... Use the name after printer, not its display description. The -d line shows the default destination, but cupsreject does not silently choose it: you must provide one or more destination names.

If lpstat reports that the scheduler is not running, start or repair CUPS before continuing. If it lists no printers, do not guess a destination. A spelling error is easy to miss because the command can fail without changing the queue you intended.

Reject new jobs with a reason

Rejecting jobs changes server state and can interrupt other users' workflows. Tell affected users why new submissions are being refused, and check that the destination name is exactly the one you found.

cupsreject -r "Maintenance until 15:00" office_bw

The -r value becomes the reason shown for a destination that is rejecting jobs. If you omit it, CUPS uses Reason Unknown, which is rarely useful during an incident. The command accepts multiple destinations, for example:

cupsreject -r "Maintenance until 15:00" office_bw office_colour

Normally there is no success message. A successful command returns to the shell without output. Depending on the CUPS policy, you may need an administrator account or an authentication prompt. Do not add sudo automatically: use it only when your local policy requires elevated access.

Checkpoint: verify that new jobs are refused

Ask CUPS for the printer status again:

lpstat -p office_bw -l

Check the output for a rejecting state and the reason you supplied. The exact formatting varies by CUPS client and server, so use the destination's reported state rather than relying on a fixed line of text. You can also inspect all destinations with:

lpstat -p

cupsreject controls whether new jobs are accepted. It does not cancel jobs already queued, remove a printer, or necessarily stop a job that is already printing. For those actions, use the separate queue or job administration commands deliberately.

Use another CUPS server

To change a destination managed by another server, pass its host and optional port with -h:

cupsreject -h printserver.example:631 -r "Maintenance until 15:00" office_bw

The server address is an operational and security boundary. Confirm it before running a state-changing command. If the connection must use encryption, add -E:

cupsreject -E -h printserver.example:631 -r "Maintenance until 15:00" office_bw

The -U option selects the username sent when connecting:

cupsreject -U print-admin -h printserver.example:631 -r "Maintenance until 15:00" office_bw

These options affect how the client connects; they do not grant permission by themselves. The server's operation policy still decides whether the request is allowed.

Restore normal operation

When maintenance is complete, accepting jobs is the direct undo operation. This also changes server state, so use the same destination and server options you used for rejection.

cupsaccept office_bw

For a remote server, repeat its connection options:

cupsaccept -E -h printserver.example:631 office_bw

Verify the destination again:

lpstat -p office_bw -l

It should now report that the printer is accepting jobs. If it still refuses submissions, check that you changed the same server and destination, then review the server's CUPS operation policy and authentication logs. Rejecting jobs is distinct from disabling a printer, so a separate disabled state may also need attention.

Done means

  • lpstat identified the exact printer or class name.
  • cupsreject returned successfully with a reason that users can understand.
  • A status check confirmed that the intended destination is rejecting new jobs.
  • cupsaccept restored acceptance after the maintenance window.