Show
Ignore:
Timestamp:
09/29/05 00:45:28 (19 years ago)
Author:
jerome
Message:

Added filters.
Added the onfail directive to tea4cups.conf

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tea4cups/trunk/tea4cups.conf

    r648 r659  
    2424[global] 
    2525 
     26 
    2627# Should we log debugging information to CUPS' error_log file ? 
    2728# defaults to No if unset. 
    2829debug : yes 
     30 
    2931 
    3032# In which directory will we create our files ? It must already exist ! 
     
    3638directory : /var/spool/cups/ 
    3739 
     40 
    3841# Should Tea4CUPS keep the files it creates once all hooks have ended ? 
    3942# Defaults to No if unset, meaning that files are automatically deleted 
     
    4447# BEWARE : this may use huge amounts of disk space ! 
    4548# keepfiles : yes 
     49 
     50 
     51# Should we launch some command when the real CUPS backend fails ? 
     52# Can be set either in the [global] section or any print queue section. 
     53# The value defined in a print queue section takes precedence over the 
     54# value defined in the [global] section. 
     55# onfail : echo "Original Backend failed" | /usr/bin/mail -s Tea4CUPS root 
     56 
     57 
     58# Should we pass incoming datas through a filter command  
     59# BEFORE doing anything else ? 
     60# NB : obvisouly the filter command doesn't have any access to 
     61#      the environment variables defined below. 
     62# Can be set either in the [global] section or any print queue section. 
     63# The value defined in a print queue section takes precedence over the 
     64# value defined in the [global] section. 
     65#  
     66# The sample filter below can remove the print job creation date 
     67# from PostScript jobs, in order to more accurately detect duplicate 
     68# jobs (so the MD5SUM would be identical from launch to launch) 
     69# 
     70# filter : /bin/grep -v "%%CreationDate:" 
     71 
    4672 
    4773# Should we serialize the launch of all hooks : launch one after 
     
    5985# serialize : yes 
    6086 
    61 # When executing the contents of a prehook or posthook directive, 
    62 # tea4cups makes the following environment variables available to your 
    63 # own commands : 
     87 
     88# When executing the contents of a prehook or posthook directive, as 
     89# defined below, tea4cups makes the following environment variables  
     90# available to your own commands : 
    6491# 
    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. 
    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?????) 
     92#      TEAPRINTERNAME : The print queue name. 
     93#      TEADIRECTORY : Tea4CUPS output directory. 
     94#      TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY). 
     95#      TEAJOBSIZE : Job's size in bytes. 
     96#      TEAMD5SUM : MD5 sum of the job's datas. 
     97#      TEACLIENTHOST : Client's hostname or IP address. 
     98#      TEAJOBID : Job's Id. 
     99#      TEAUSERNAME : Name of the user who launched the print job. 
     100#      TEATITLE : Job's title. 
     101#      TEACOPIES : Number of copies requested. 
     102#      TEAOPTIONS : Options of the print job. 
     103#      TEAINPUTFILE : Job's data file or empty when job read from stdin. 
     104#      TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps) 
     105#      TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????) 
    79106# 
    80107# Your own commands will mostly be interested in TEADATAFILE which is 
     
    82109# job's datas. Don't rely on TEAINPUTFILE, use TEADATAFILE instead 
    83110# since the first one may be empty depending on your printer driver. 
     111 
    84112 
    85113# Some prehooks and posthooks 
     
    121149#posthook_0 : cat $TEADATAFILE >~$TEAUSERNAME/savejobs/$TEAJOBID.prn 
    122150 
     151 
    123152# An empty value deletes a value defined in the [global] section 
    124153# so this particular hook doesn't get executed on this printer. 
    125154#prehook_pdf : 
    126155 
     156 
    127157# A reflector which produces 4 copies each time : 
    128158#posthook_4copies : lp -dotherprinter -n4 $CUPSDATAFILE 
    129159 
     160 
    130161# A simple accounting mechanism 
    131162#prehook_accounting : echo $TEAPRINTERNAME $TEAJOBID $TEAUSERNAME $TEABILLING `pkpgcounter $TEADATAFILE` >/var/log/printaccounting.log 
     163 
    132164 
    133165# Some additionnal hooks to forbid duplicate jobs : 
     
    143175#posthook_to_filter_duplicates : echo "$TEAJOBID : $TEAMD5SUM" >>/tmp/jobmd5sums 
    144176 
     177 
    145178# A particular prehook can send datas to the posthook 
    146179# of the same name automatically through pipes :