Operating System - HP-UX
1820390 Members
3986 Online
109623 Solutions
New Discussion юеВ

script to check print queue status

 
SOLVED
Go to solution
Tracy Force
Occasional Contributor

script to check print queue status

I am new to this and am trying to figure out how to get a script to do an lpstat -t and give me an output of jobs older than 15 mins, then I am going to send it to an ipager. any help is greatly appreciated. THANKS
I've done some reading and gotten a few examples that I'm looking at to see if they will help me at all.
6 REPLIES 6
Ermin Borovac
Honored Contributor
Solution

Re: script to check print queue status

I've attached small perl script that will print details of jobs that are older than 15 minutes.

Output should be in the format

Request - owned by in the queue since : ()
Tracy Force
Occasional Contributor

Re: script to check print queue status

great thanks.. I'll try it out and see what I get.

Tracy Force
Occasional Contributor

Re: script to check print queue status

hmm.. it didn't work.. how can I convert to korn script?.. thanks
jerry1
Super Advisor

Re: script to check print queue status

Here is a script that I wrote to clear out
any print jobs older that 24 hours.
You may be able to modify or gleen something
from it.

#!/bin/ksh
#
# Cancel stuck printer jobs over 24 hours old.
# Jerry Moore 3/29/04

lpstat -o | grep priority | grep -v "`date | cut -c 5-10`" | awk '{print $1}'>/tmp/stkprjobs
for i in `cat /tmp/stkprjobs`;do
cancel $i
done


Sanjay_6
Honored Contributor

Re: script to check print queue status

Hi Tracy,

There is a couple of choices in this link for a similar forum post. you may have to do some modification to suit your individual needs,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=121243

Hope this helps.

Regds
Tracy Force
Occasional Contributor

Re: script to check print queue status

yeaaaaaaaaaaaaahaaaaw... y'all rock.. THANK YOU, now back to learning ..