Friday, February 8, 2013

Resuming stalled or held CUPS print jobs…

Posted by Jim@TheDailyLinux in Uncategorized » Add Comment » 

I have a network printer, and it’s surprising how often I print a job and then find the printer is not switched on, and the print job gets put in HOLD state. Using “lpstat -l” one can view the print job status, and with the “lp” command can resume the print job. But I’m idle, so I created this very simple script to do it all in one command – I call it “lprel”.

#!/bin/sh## script to resume the top job on the default printer queuej=`lpstat | head -1 | cut -d' ' -f1`if [ "$j" = "" ]; then echo 1>&2 "No jobs in queue." exit 1fiecho "releasing \"$j\"..."lp -i "$j" -H resumelpstat -l

cheers
Jim


Complete Post View Here

No comments:

Post a Comment