Skip to main content
Solved

resuming a paused printer on 10.8

  • March 6, 2013
  • 4 replies
  • 31 views

Forum|alt.badge.img+21

Hi guys

i tried sudo lpadmin -E -p printer_name

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

Best answer by tkimpton

#!/bin/bash


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

cupsenable $printer

4 replies

Forum|alt.badge.img+21
  • Author
  • Honored Contributor
  • March 6, 2013

it was cupsenable printer_name


Forum|alt.badge.img+21
  • Author
  • Honored Contributor
  • Answer
  • March 6, 2013
#!/bin/bash


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

cupsenable $printer

Forum|alt.badge.img+5
  • New Contributor
  • October 1, 2014

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.


Forum|alt.badge.img+4
  • Contributor
  • December 6, 2018

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.