Clearing Stopped Mac Print Queues (automatically, using scripts)

KB Home   |   Clearing Stopped Mac Print Queues (automatically, using scripts)

Main.ClearingStoppedMacPrintQueues History

Hide minor edits - Show changes to output

Changed line 7 from:
->Firstly make sure print queues are resumed. This can be done with the following command.  For instance it can runas a launchd daemon every two minutes:
to:
->Firstly make sure print queues are resumed. This can be done with the following command.  For instance, it can run as a launchd daemon every two minutes:
Changed line 8 from:
-->[@/usr/sbin/cupsenable `lpstat -p | lpstat -p | sed -nEe '/disabled/s/^[^ ^I]+[ ^I]([^ ^I]+)[ ^I]+.*$/\1/p'`@]
to:
-->[@/usr/sbin/cupsenable `lpstat -p | sed -nEe '/disabled/s/^[^ ^I]+[ ^I]([^ ^I]+)[ ^I]+.*$/\1/p'`@]
Changed lines 5-9 from:
[[http://gustavus.edu/profiles/svogt | Steve]] from [[http://gustavus.edu/ | Gustavus Adolphus College]] contributed the following scripts to start stopped queues and clear stopped jobs.  These scripts are for Mac OS 10.5 (Leopard) Server.  Other versions or non-server editions may require different commands or arguments.

->First thing I need to do was make sure my queues were resumed.  It can be done with this command.  I run this as a launchd daemon every 2 minutes:
-->[@/usr/sbin/cupsenable `lpstat -p | grep 'disabled' | awk '{print $2}'`@]
to:
[[http://gustavus.edu/ | Gustavus Adolphus College]] contributed the following scripts to start stopped queues and clear stopped jobs.  These scripts have been updated for Mac OS 10.8 (Mountain Lion).  Other versions may require different commands or arguments.

->Firstly make sure print queues are resumed. This can be done with the following command.  For instance it can runas a launchd daemon every two minutes:
-->[@/usr/sbin/cupsenable `lpstat -p | lpstat -p | sed -nEe '/disabled/s/^[^ ^I]+[ ^I]([^ ^I]+)[ ^I]+.*$/\1/p'`@]
-->Note that [@[ ^I]@] is the character class for a space and a tab character.

Changed lines 14-17 from:
-->[@/usr/bin/cancel -a `lpstat -p |  awk '{print $2}'`@]

->launchd is actually what
is used to set the time interval.  A user can easily do this with a program called [[http://www.tuppis.com/lingon/ | Lingon]] and set it to any amount of time or they can write a launchd script.
to:
-->[@/usr/bin/cancel -a@]

->launchd is used to set the time interval.  A user can easily do this with a program called [[http://www.tuppis.com/lingon/ | Lingon]] and set it to any amount of time or they can write a launchd script.
Changed lines 3-4 from:
After a printer error like a paper jam a Mac print queue may need to be manually started before jobs start printing again.  The same can be true if a "bad" job is encountered - the other jobs won't print until it is cleared.
to:
After a printer error like a paper jam or a communication problem a Mac print queue may need to be manually started before jobs start printing again.  The same can be true if a "bad" job is encountered - the other jobs won't print until it is cleared.
Added lines 17-18:
[-keywords: cupsd, cups, pause, paused-]
Changed lines 5-6 from:
[[http://gustavus.edu/profiles/svogt | Steve]] from [[http://gustavus.edu/ | Gustavus Adolphus College]] contributed the following scripts to start stopped queues and clear stopped jobs:
to:
[[http://gustavus.edu/profiles/svogt | Steve]] from [[http://gustavus.edu/ | Gustavus Adolphus College]] contributed the following scripts to start stopped queues and clear stopped jobs.  These scripts are for Mac OS 10.5 (Leopard) Server.  Other versions or non-server editions may require different commands or arguments.
Added lines 1-18:
(:title Clearing Stopped Mac Print Queues (automatically, using scripts):)

After a printer error like a paper jam a Mac print queue may need to be manually started before jobs start printing again.  The same can be true if a "bad" job is encountered - the other jobs won't print until it is cleared.

[[http://gustavus.edu/profiles/svogt | Steve]] from [[http://gustavus.edu/ | Gustavus Adolphus College]] contributed the following scripts to start stopped queues and clear stopped jobs:

->First thing I need to do was make sure my queues were resumed.  It can be done with this command.  I run this as a launchd daemon every 2 minutes:
-->[@/usr/sbin/cupsenable `lpstat -p | grep 'disabled' | awk '{print $2}'`@]

->This will resume the queue and leave the bad job "stopped" - basically the queue resumes and just skips over this job.

->To clear the "stopped" jobs I run the following launchd daemon at night when the printers aren't being used:
-->[@/usr/bin/cancel -a `lpstat -p |  awk '{print $2}'`@]

->launchd is actually what is used to set the time interval.  A user can easily do this with a program called [[http://www.tuppis.com/lingon/ | Lingon]] and set it to any amount of time or they can write a launchd script.

----
''Categories:'' [[Category.Scripting|+]]

Comments

Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.

Article last modified on February 19, 2013, at 12:24 AM
Printable View   |   Article History   |   Edit Article