Holding jobs for a certain amount of time

Kurt Pfeifle k1pfeifle at gmx.net
Mon Sep 24 13:00:53 PDT 2007


Mohammad wrote:
> Hi, I have added the following option in my printer configuration file 
> to hold all jobs coming to printer:
> Option job-hold-until indefinite
> 
> But, I need every job be held there for a certain amount of time, say 
> 30 mins, and then it automatically gets canceled instead of getting
> printed.
> 
> By specifying the option I have used, all jobs will be remained in the 
> queue, while many of them will not be printed in future.
> 
> Any idea how to achieve this functionality?


CUPS currently only supports the standard IPP option values for "job-
hold-until", AFAIK.

These values are (according to RFC 2911):

 'no-hold': print immediately, if there are not other reasons to hold
            the job
 'indefinite': job is held indefinitely, until a client performs a
               Release-Job (section 3.3.6)
 'day-time': print during the day
 'evening': print at the evening
 'night': print at night
 'weekend': print next weekend
 'second-shift': print during second-shift (after close of business)
 'third-shift': print during third-shift (after midnight)

It's left to your own evaluation if you find these definitions to be
useful and precise and complete enough for an accepted IETF standard.

CUPS adds a value of its own, by allowing you to specify the UTC time
for printing, and also makes the other RFC definitions a bit more
precise:

 -o job-hold-until=indefinite   ; print only after released by the
                                  job-owner or an administrator
 -o job-hold-until=day-time     ; print from 6am to 6pm local time
 -o job-hold-until=night        ; print from 6pm to 6am local time
 -o job-hold-until=second-shift ; print from 4pm to 12am local time
 -o job-hold-until=third-shift  ; print from 12am to 8am local time
 -o job-hold-until=weekend      ; print on Saturday or Sunday
 -o job-hold-until=HH:MM        ; print at the specified UTC (!) time

So currently it is not possible to say "if job is not released within
30 minutes, delete it".

You'll have to write your own script, run by cron, to automatically
delete all jobs that are older than 30 minutes.

Have a look here to get some ideas how you could do that:

  http://www.cups.org/newsgroups.php?s1+gcups.general+v9+T+Q%22delete+old+print+jobs%22

Just use

   date -d "31 minutes ago"

as a basis for finding those jobs that are already older than 30 minutes.

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list