resuming a paused printer on 10.8

tkimpton
Valued Contributor II

Hi guys

i tried sudo lpadmin -E -p printer_name

but this disnt resume the printer. Has anyone else seen this in mountain lion?

1 ACCEPTED SOLUTION

tkimpton
Valued Contributor II
#!/bin/bash


printer=`lpstat -p | grep "disabled" | awk '{print $2}'`

cupsenable $printer

View solution in original post

4 REPLIES 4

tkimpton
Valued Contributor II

it was cupsenable printer_name

tkimpton
Valued Contributor II
#!/bin/bash


printer=`lpstat -p | grep "disabled" | awk '{print $2}'`

cupsenable $printer

JAMAUAI
New Contributor II

I put this one-liner into a script and included it in our imaging - works like a charm!

lpstat -p | grep "disabled" | awk '{print $2}' | xargs -n 1 -I{} sudo cupsenable {}

Thanks @tkimpton for the idea.

adminNWA
New Contributor III

I made two changes to the final script that was posted

lpstat -p | grep -B 1 "Paused" | awk '{print $2}' | xargs -n 1 -I{} sudo cupsenable {}

The reason is that printers that ave been deleted can sometimes show in lpstat as being disabled. While I did not necessarily think that that would cause the script to fail, I only want to resume print queues that have been paused.

In my OSX 10.13 the 'Paused' notification was displaying on the line below (as such)

printer Buchan_2B disabled since Thu Dec 6 12:58:23 2018 - Paused

so I added the -B 1 modifier.