Linux: How to start and stop printer queues

last updated in Categories , , , , , ,

Q. How can I start and stop printer queues for printer called HPLJF2?


A. To stop/start printers and classes queues use enable (to start queue) command. There is also disable command to stop queue.

Linux Printer Control Command names

=> enable or cupsenable: To start the named printers or classes.

=> disable or cupsdisable: To stop the named printers or classes.

Task: Start a print queue

Type the following command to START a print queue for a printer called HPLJF2:
# /usr/bin/enable HPLJF2

Task: Stop a print queue

Type the following command to STOP a print queue for a printer called HPLJF2:
# /usr/bin/disable printer

Please note that use full path name for both commands. Otherwise you will end up running bash internal enable,which is use to enable and disable builtin bash shell commands.

Task: Verify queue is stopped or started

Use lpq command verify the queue is stopped or started:
# lpq

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


9 comment

  1. I have some print queues that drop, I need a script that will check what queues are up and enable anything that is down, my scripting skills are not good enough to be able to setup and automated script. Does anyone have a script that will automatically restart downed print queues in aix 5.3

    1. I’ve written scripts that will do this for AIX; they also will send e-mail or open a help-desk ticket for stalled queues or queues that can’t be restarted automatically. Let me know if you still need something like this (I know it’s been a long time since you posted).

      1. Dear Bro Dennis

        Kindly share that script., we have configured 200+ printers in AIX more of them are using HP Jetdirect and some of remote printer.,

        we need script to monitor print queue if down it should enable and send mail alert

        Thanks in Advance..
        Mohammed Fahad.

  2. Is there a way to get cups to send a notification email when it disables a print queue? This is a sure sign something needs to be fiddled with, at least a paper jam.

Leave a Comment