Posted on 02-11-2014 08:14 AM
Does anyone have a good script that will automatically clear any stuck print job after a period of time?
Posted on 02-11-2014 11:06 AM
I run the following on logout. This way the print queue is cleared for the next user.
cancel -a; cupsenable `lpstat -p | grep 'disabled' | awk '{print $2}'`
Posted on 02-12-2014 06:55 AM
I run the following on logout. It cancels any jobs that may be pending and then ensures the printer is not paused.
Replace PRINTER## with then name of your printers
cancel -a; cupsenable PRINTER#1; cupsenable PRINTER#2; cupsenable #3; cupsenable PRINTER#4
Posted on 02-12-2014 08:39 AM
I run the below, after installing printers, to set the printer to "abort the job" on error rather than pausing printing. JAMF's capture method doesn't seem to pick this up from the printers.conf if one was to set it manually. Otherwise, I do something similar to @cbrewer
#!/bin/sh -v
exec 2>&1
####Obtain the printers as an array
PRINTERS="`lpstat -v | awk '{print $3}' | sed 's/://'`"
####Loops through the printers and applies the error policy to them
for P in ${PRINTERS[@]}
do
lpadmin -p $P -o printer-error-policy=abort-job
done