Adding a Printer From Command Line In LINUX (RHEL6)

A small command was all I needed to add a Print Queue on Print Server 🙂

lpadmin -p printer_name -E -v beh:/1/0/30/socket://printer_name.fqdn:9100 -P /etc/cups/ppd/driver.ppd

Description of beh:/1/0/30 :- 1 means don’t disable print job, 0 means infinite tries if job fails & 30 means number of seconds between each retry.

lpstat -p printer_name -l shows if its correctly configured or not.

[root@server~]# lpstat -p printer_name -l
printer printer_name is idle. enabled since Thu 08 Jan 2015 03:30:09 PM CET

There’s a little caveat to it. BEH (Backend Error Handler) was not getting recognised 😦 Actually, beh file is a perl script & it needs executable rights. Also, its ownership was not with root. So I changed the permission & ownership. Restarting the cups service enabled BEH with CUPS 🙂

lpinfo -v shows beh in its output if BEH is successfully tied with CUPS.

[root@server ~]# lpinfo -v
network lpd
network https
network socket
direct scsi
network http
network ipp
network beh
serial serial:/dev/ttyS0?baud=115200
serial serial:/dev/ttyS1?baud=115200


2 thoughts on “Adding a Printer From Command Line In LINUX (RHEL6)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s