11
Oct

Resuming stalled or held CUPS print jobs…

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 queue

j=`lpstat | head -1 | cut -d' ' -f1`
if [ "$j" = "" ]; then
  echo 1>&2 "No jobs in queue."
  exit 1
fi
echo "releasing \"$j\"..."
lp -i "$j" -H resume
lpstat -l

cheers
Jim

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 0 Comment So Far

Share your thoughts, leave a comment!