root / tea4cups / trunk / tea4cups.conf @ 648

Revision 648, 6.4 kB (checked in by jerome, 19 years ago)

3.00 is now out !
Official packages available later in the night...

  • Property svn:keywords set to Auth Date Id Rev
RevLine 
[571]1# $Id$
2#
[576]3# Tea4CUPS : Tee for CUPS
[571]4#
[612]5# (c) 2005 Jerome Alet <alet@librelogiciel.com>
[644]6# (c) 2005 Peter Stuge <stuge-tea4cups@cdy.org>
[571]7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
[645]11#
[571]12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
[645]16#
[571]17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
[644]19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
[571]20#
[645]21#
[577]22
23# First we set all top-level directives in the [global] section
[571]24[global]
[577]25
26# Should we log debugging information to CUPS' error_log file ?
27# defaults to No if unset.
[571]28debug : yes
[577]29
[580]30# In which directory will we create our files ? It must already exist !
[577]31# This directive MUST be present since there's no sane default value.
[580]32# Can be set either in the [global] section or any print queue section.
33# The value defined in a print queue section takes precedence over the
34# value defined in the [global] section.
[598]35# directory : /var/spool/tea4cups/
[577]36directory : /var/spool/cups/
37
[644]38# Should Tea4CUPS keep the files it creates once all hooks have ended ?
[580]39# Defaults to No if unset, meaning that files are automatically deleted
[644]40# once all hooks have ended.
[580]41# Can be set either in the [global] section or any print queue section.
42# The value defined in a print queue section takes precedence over the
43# value defined in the [global] section.
[577]44# BEWARE : this may use huge amounts of disk space !
[580]45# keepfiles : yes
[577]46
[644]47# Should we serialize the launch of all hooks : launch one after
[580]48# the other to save some system resources.
[644]49# Defaults to No if unset, meaning that all hooks are launched in
[580]50# parallel.
[598]51#
[645]52# NB : in any case, hooks' names are sorted alphabetically and
[598]53# are launched in this sort order (obviously when launched in parallel
54# this is unnoticeable).
[645]55#
[580]56# Can be set either in the [global] section or any print queue section.
57# The value defined in a print queue section takes precedence over the
58# value defined in the [global] section.
59# serialize : yes
60
[645]61# When executing the contents of a prehook or posthook directive,
[597]62# tea4cups makes the following environment variables available to your
63# own commands :
[577]64#
[580]65# TEAPRINTERNAME : The print queue name.
66# TEADIRECTORY : Tea4CUPS output directory.
67# TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY).
68# TEAJOBSIZE : Job's size in bytes.
69# TEAMD5SUM : MD5 sum of the job's datas.
70# TEACLIENTHOST : Client's hostname or IP address.
71# TEAJOBID : Job's Id.
72# TEAUSERNAME : Name of the user who launched the print job.
73# TEATITLE : Job's title.
74# TEACOPIES : Number of copies requested.
75# TEAOPTIONS : Options of the print job.
[615]76# TEAINPUTFILE : Job's data file or empty when job read from stdin.
77# TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps)
78# TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????)
[577]79#
80# Your own commands will mostly be interested in TEADATAFILE which is
81# the name of the file from which your commands may extract the final
[615]82# job's datas. Don't rely on TEAINPUTFILE, use TEADATAFILE instead
83# since the first one may be empty depending on your printer driver.
[645]84
[648]85# Some prehooks and posthooks
[597]86#
[645]87# Prehooks are guaranteed to be launched
88# BEFORE the job's datas are sent to the printer, and
[597]89# posthooks are guaranteed to be launched AFTER the job's
90# datas have been sent to the printer.
91#
92# prehook names are completely free BUT THEY MUST BEGIN WITH 'prehook_'
93# posthook names are completely free BUT THEY MUST BEGIN WITH 'posthook_'
94#
95# An additionnal environment variable is made available to posthooks,
96# named TEASTATUS which contains the exitcode of the real CUPS backend.
[648]97# If defined, the normal value is 0, meaning that the real CUPS backend exited
[597]98# successfully. Any other value indicates that a problem occured
99# in the CUPS backend which handles the transmission of the job
100# to the printer.
[645]101#
[597]102# prehook_0 : echo "Your print job has been accepted" | smbclient -M $TEAUSERNAME
[598]103# posthook_0 : echo "Your print job has been printed with status $TEASTATUS" | smbclient -M $TEAUSERNAME
[601]104#
[645]105# NB : as a special feature, any prehook which exits with a -1 status (255)
[602]106# causes the job to NOT be sent to the real backend, effectively cancelling it.
[645]107# None of the posthooks gets executed in this case, but all
[602]108# remaining prehooks are still executed.
[645]109#
[644]110#prehook_pdf : cat $TEADATAFILE | su -c "lp -dPDFGenerator" $TEAUSERNAME
111#posthook_0 : cat $TEADATAFILE >/tmp/$TEAJOBID.prn
[597]112
113
[571]114# Sample section for print queue HP2100
115# Uncomment and adapt to your needs.
116#
[580]117#[HP2100]
[571]118#
[644]119# By using a same hook name as in the [global] section, the new
[580]120# value takes precedence
[644]121#posthook_0 : cat $TEADATAFILE >~$TEAUSERNAME/savejobs/$TEAJOBID.prn
[598]122
[580]123# An empty value deletes a value defined in the [global] section
[644]124# so this particular hook doesn't get executed on this printer.
[645]125#prehook_pdf :
[598]126
[580]127# A reflector which produces 4 copies each time :
[645]128#posthook_4copies : lp -dotherprinter -n4 $CUPSDATAFILE
[598]129
[645]130# A simple accounting mechanism
[644]131#prehook_accounting : echo $TEAPRINTERNAME $TEAJOBID $TEAUSERNAME $TEABILLING `pkpgcounter $TEADATAFILE` >/var/log/printaccounting.log
[598]132
[620]133# Some additionnal hooks to forbid duplicate jobs :
134# The prehook will use the history file to filter out duplicate jobs
[645]135# checkdupes is an hypothetical command which exits -1 if the current print
[648]136# job is a duplicate (same MD5 sum already found in history).
137#
138# NB : Beware of some software which embed the job printing time into the
139# PostScript job : two identical jobs may have different MD5 checksums
140# if they differ only by the value of the '%%CreationDate:' PostScript
141# comment !
[620]142#prehook_to_filter_duplicates : /usr/local/bin/checkdupes $TEAMD5SUM /tmp/jobmd5sums
143#posthook_to_filter_duplicates : echo "$TEAJOBID : $TEAMD5SUM" >>/tmp/jobmd5sums
[648]144
145# A particular prehook can send datas to the posthook
146# of the same name automatically through pipes :
147# The file /tmp/result1 will contain the output of prehook_dialog1
148# prehook_dialog1 : echo "This is pipe #1"
149# posthook_dialog1 : cat >/tmp/result1
150# The file /tmp/result2 will contain the output of prehook_dialog2
151# prehook_dialog2 : echo "This is pipe #2"
152# posthook_dialog2 : cat >/tmp/result2
Note: See TracBrowser for help on using the browser.