# $Id$ Tea4CUPS : Tee for CUPS (c) 2005 Jerome Alet 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. ============================================================================= Tea4CUPS is the equivalent of the *nix command 'tee', but as a CUPS backend. Tea4CUPS behaves just like any other CUPS backend, but allows you to transparently send print jobs' datas to any number of outputs : other CUPS backends, files or pipes. This for example allows you to output the same print job on several printers at the same time, which is not possible with CUPS. Another possibility would be for example to send the same document to a printer, a PDF generator, a Fax, and as an attachment to an email message, all of this by printing it a single time. Tea4CUPS provides three ways to launch commands : - prehooks : these are guaranteed to be launched before the print job is sent to the real printer. Any prehook which exits -1 can cancel the print job. - tees : these are launched at the same time the job is being sent to the real printer, unless the job was previously cancelled by a prehook. - posthooks : these are guaranteed to be launched after the print job has been sent to the real printer, unless the job was previously cancelled by a prehook. To help your own commands, Tea4CUPS makes available as part of the environment several variables which can be used from the commands you use : 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. TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps) TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????) TEASTATUS : Original CUPS backend's exit code : ONLY AVAILABLE FROM posthooks, obviously. In the case you want to use both Tea4CUPS and PyKota, you MUST install PyKota v1.22alpha2 or higher to avoid a race condition. ============================================================================= Installation : -------------- 0 - Download Tea4CUPS from : http://www.librelogiciel.com/software/Tea4CUPS/action_Presentation and extract it : $ tar -zxf tea4cups-x.yy.tar.gz where x.yy is Tea4CUPS' version number. 1 - Copy the 'tea4cups' command into CUPS' backend directory, for example : $ cp tea4cups /usr/lib/cups/backend 2 - Restart CUPS in order for this new backend to be detected. 3 - Either from CUPS' web interface, add new printers with 'Tea4CUPS managed' in front of the device's name. Or by directly modifying CUPS' printers.conf file, prepend each DeviceURI value with 'tea4cups://', and restart CUPS. 4 - Copy tea4cups.conf into CUPS' configuration directory (where cupsd.conf resides) : $ cp tea4cups.conf /etc/cups/ 5 - Modify tea4cups.conf to suit your needs. Several examples are included. 6 - There's no 6 ! ============================================================================= Troubleshooting : ----------------- 1 - Set "LogLevel debug2" in CUPS' cupsd.conf 2 - Restart CUPS. 3 - Set "debug: yes" in the [global] section of tea4cups.conf 4 - Print something on a print queue managed by Tea4CUPS. 5 - Look at CUPS' error_log file for diagnostic and error messages. ============================================================================= CUPS (Common UNIX(r) Printing System) is trademark property of Easy Software Products. You can download CUPS from : http://www.cups.org ============================================================================= Please e-mail bugs to : alet@librelogiciel.com (Jerome Alet)