Using the command line to unpause/enable printers in Leopard

~~Nerd Content Ahead~~

With a recent upgrade to Leopard from Tiger, we’re having a lot of issues where the computers are constantly pausing the printers locally on each machine. In Tiger, the user could resume the printer, but in Leopard the user requires admin rights to resume them. This is causing problems because student and teacher accounts in our division don’t have admin rights. This means I have to go around to each computer and enter admin credentials to unpause them. This is a giant waste of time, so I want to use the command line or a script to unpause/enable them.

So after much research and fiddling, I finally figured it out!

I use three commands that I’ve put into a script, and send out via ARD with the UNIX command option. They will unpause/enable the printer so that users can resume printing.

Here are the commands:

#finds printers that are currently disabled and clears the queue on them
cancel -a `lpstat -t | grep disabled | awk ‘{print $2}’`
#re-enable stopped print queues
cupsenable `lpstat -t | grep disabled | awk ‘{print $2}’`
#checks to see that all printers are re-enabled. should return nothing
lpstat -t | grep disabled | awk ‘{print $2}’

The only issue I’ve come across is that if the printer is being unpaused immediately following it being paused, then remove the top command which clears the queue, and just run the second two. This won’t clear the queue, and unpause the printer so that the job goes through immediately.

I know there is a larger problem with the way our queues and printers are setup, so this is just a quick fix in the meantime, but I’m pretty proud of myself for figuring out this much as it is saving me a ton of work and headaches.


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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