Hi,
This is probably not the best way to do it, but I use a cron job every 5 minutes to run a script which looks for jobs which have been in the queue for over 10 minutes (as the cron job is only every 5 mins, there's some variability in lifespan).
I'm using RedHat 8 and lprng 3.8.20
The script is:
#!/bin/sh
lpq -Pwb307-2100 > /print_stuff/curr_queue.txt
/print_stuff/pqoldjobs /print_stuff/curr_queue.txt `date +"%T"` 00:10:00 > /print_stuff/list_of_jobs_to_remove.txt
lprm -Pwb307-2100 `cat /print_stuff/list_of_jobs_to_remove.txt` > /dev/null
The 00:10:00 is in HH:MM:SS format, and is the "lifespan" of jobs.
Not sure what the size limit for posts to this list is, so as it's my first post, I'll not put the source for the C++ program "pqoldjobs" right away, but if anyone wants it I can send it to them, or send it to the list? It's very much a first draft, but seems to work and might be a useful starting point for someone.
Cheers, Ian
================================ | Ian Hannent | | Computer Technician | | Department of Psychology | | Goldsmiths College | |------------------------------| | e-mail: [EMAIL PROTECTED] | ================================
--On 17 September 2003 09:23 +0200 Johan Bengtsson <[EMAIL PROTECTED]> wrote:
On Tue, 16 Sep 2003, Hans Peter Verne wrote:
Henrik Edlund wrote:
> Why? You can't just go about and delete jobs because the printer > ran out of paper.
Why not?
Off-topic, I know. But it seems to me that most people (or at least many people, at the Univ. of Oslo) consider print services to be a real-time thing. They print, and plod over to the printer. If the job is not there, well, it must have been eaten somewhere, better go back and print again. Etc. etc. ad nauseaum.
Exactly. And this is especially true about newbie users, and I've got about 150 in my system right now.
I don't know how many times I've cleared a stuck print queue for identical copies of the same job. I've played with the thought of having a per printer configurable max lifetime in the queue -- if the job has not been printed within 10 minutes, ditch it.
This is what I wanted. The only alternative is to let users do 'lprm -Pprinter all', but I'm not sure if that is a good solution.
-Johan Bengtsson
-- http://www.dd.chalmers.se/~elijah/
------------------------------------------------------------------- ---------- YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests or lprng-digest-requests) with the word 'help' in the body. For the impatient, to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED] with: | example: subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED] unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word LPRNGLIST in the SUBJECT line. ------------------------------------------------------------------- ----------
----------------------------------------------------------------------------- YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests or lprng-digest-requests) with the word 'help' in the body. For the impatient, to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED] with: | example: subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED] unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word LPRNGLIST in the SUBJECT line. -----------------------------------------------------------------------------
