Home / Alt manpages / cupsreject(8)

  • cupsreject(8)
  • Admin command
  • linux

Stop New Print Jobs with cupsreject

When a printer needs an engineer inside it, cupsreject stops the queue growing while cupsaccept quietly undoes it afterwards. You will make a CUPS printer or class refuse new jobs, set a visible reason, check the result with lpstat, and restore acceptance with cupsaccept once the interruption is over.

This takes about five minutes once you know the destination name. It applies to cups-client version 2.4.7-1.2ubuntu7.14 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 ask for authentication depending on server policy.

1. Identify the destination

List printers and their current state first. This is a read-only check, safe to run before you have decided anything:

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 never guesses one for you: you must name one or more destinations explicitly.

Checkpoint

If lpstat says the scheduler is not running, start or repair CUPS before continuing. If it lists no printers, do not guess a name. A spelling mistake here is easy to miss, because the command can fail without touching the queue you actually meant.

2. Reject new jobs with a reason

Rejecting jobs changes server state and can interrupt other people's work, so check the destination name is exactly right and tell affected users why submissions are being refused:

cupsreject -r "Maintenance until 15:00" office_bw

The -r value becomes the reason shown for a destination that is rejecting jobs. Skip it and CUPS falls back to Reason Unknown, which is no help mid-incident. The command takes multiple destinations too:

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

A successful run is normally silent: no message, just the shell prompt back. Depending on the CUPS policy, you may need an administrator account or an authentication prompt. Do not bolt on sudo automatically; use it only when your local policy actually requires elevated access.

3. 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. Formatting varies by CUPS client and server version, so read the destination's reported state rather than matching a fixed line of text. To see everything at once:

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. Reach for the separate queue or job administration commands for those, deliberately.

4. Use another CUPS server

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

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

Security boundary

The server address matters. Confirm it before running any state-changing command. Add -E if the connection must be encrypted:

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

-U selects the username sent when connecting:

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

These options change how the client connects; they do not grant permission by themselves. The server's own operation policy still decides whether the request goes through.

5. Restore normal operation

Once maintenance is finished, accepting jobs again is the direct undo. This also changes server state, so use the same destination and server options you used to reject:

cupsaccept office_bw

For a remote server, repeat its connection options:

cupsaccept -E -h printserver.example:631 office_bw

Verify the destination once more:

lpstat -p office_bw -l

It should now report that the printer is accepting jobs. If it still refuses them, check you changed the same server and destination, then look at the operation policy and authentication logs. Rejecting jobs is a separate switch from disabling a printer, so a disabled state may need its own fix.

Done means

  • Identified the exact printer or class name with lpstat before touching anything.
  • Ran cupsreject with a reason that another operator can actually understand.
  • Confirmed the rejecting state with a follow-up status check.
  • Restored acceptance with cupsaccept once the maintenance window closed.