# $Id$ # # Tea4CUPS : Tee for CUPS # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # # # First we set all top-level directives in the [global] section [global] # Should we log debugging information to CUPS' error_log file ? # defaults to No if unset. debug : yes # In which directory will we create our files ? It must already exist ! # This directive MUST be present since there's no sane default value. # Can be set either in the [global] section or any print queue section. # The value defined in a print queue section takes precedence over the # value defined in the [global] section. directory : /var/spool/cups/ # Should Tea4CUPS keep the files it creates once all tees have ended ? # Defaults to No if unset, meaning that files are automatically deleted # once all tees have ended. # Can be set either in the [global] section or any print queue section. # The value defined in a print queue section takes precedence over the # value defined in the [global] section. # BEWARE : this may use huge amounts of disk space ! # keepfiles : yes # Should we serialize the launch of all tees : launch one tee after # the other to save some system resources. # Defaults to No if unset, meaning that all tees are launched in # parallel. # Can be set either in the [global] section or any print queue section. # The value defined in a print queue section takes precedence over the # value defined in the [global] section. # serialize : yes # When executing the contents of a tee directive, tea4cups makes # the following environment variables available to your own commands : # # TEAPRINTERNAME : The print queue name. # TEADIRECTORY : Tea4CUPS output directory. # TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY). # TEAJOBSIZE : Job's size in bytes. # TEAMD5SUM : MD5 sum of the job's datas. # TEACLIENTHOST : Client's hostname or IP address. # TEAJOBID : Job's Id. # TEAUSERNAME : Name of the user who launched the print job. # TEATITLE : Job's title. # TEACOPIES : Number of copies requested. # TEAOPTIONS : Options of the print job. # TEAINPUTFILE : Print job's data file or empty when job read from stdin. # # Your own commands will mostly be interested in TEADATAFILE which is # the name of the file from which your commands may extract the final # job's datas. # Now defines some default tees which will always be launched # The tee names are completely free BUT THEY MUST BEGIN WITH 'tee_' # # These are just some stupid examples. #tee_0 : cat $TEADATAFILE >/tmp/$TEAJOBID.prn #tee_pdf : cat $TEADATAFILE | su -c "lp -dPDFGenerator" $TEAUSERNAME # Sample section for print queue HP2100 # Uncomment and adapt to your needs. # #[HP2100] # # By using a same tee name as in the [global] section, the new # value takes precedence #tee_0 : cat $TEADATAFILE >~$TEAUSERNAME/savejobs/$TEAJOBID.prn # An empty value deletes a value defined in the [global] section # so this particular tee doesn't get executed. #tee_pdf : # A reflector which produces 4 copies each time : #tee_4copies : lp -dotherprinter -n4 $CUPSDATAFILE # A simple accounting mechanism #tee_accounting : echo $TEAPRINTERNAME $TEAJOBID $TEAUSERNAME `pkpgcounter $TEADATAFILE` >/var/log/printaccounting.log