Using Samba v1.9.18p3 on a Linux system, I find that that any print jobs sent to a shared printer results in doubled files. It's not that 2 copies of the print job are actually *printed*, it's just a matter of dual spool files being created. For example, the content of the /var/spool/lpd/lj4m directory: -rw-rw---- 1 bin lp 127 Mar 15 17:48 cfA315Aa10463 -rw-rw---- 1 root root 0 Mar 15 17:48 cfA315Aa10464 -rw-rw---- 1 steve lp 1417816 Mar 15 17:48 dfA315Aa10463 -rw-rw-r-- 1 root root 1417816 Mar 15 17:48 dfA315Aa10464 -rwxr-xr-x 1 root root 9289 Dec 16 10:31 filter -rwxr-xr-x 1 root root 191 Dec 16 10:31 general.cfg -rw-r--r-- 1 root root 20 Mar 15 17:48 lock -rwxr-xr-x 1 root root 342 Dec 16 10:31 postscript.cfg -rw-rw-r-- 1 root root 29 Mar 15 17:48 status -rwxr-xr-x 1 root root 146 Dec 16 10:31 textonly.cfg The 1.4MB print job above was created by me (user "steve"). So why is there a duplicate file owned by root? My Samba printer type is undefined (so it's BSD by default), and my [Printers] section of smb.conf looks like this: [printers] comment = All Printers browseable = No path = /var/spool/samba create mask = 0700 guest ok = Yes print ok = Yes For small, text-only print jobs, I don't much care that duplicate spool files are created. The problem is that we routinely print large (10+ megabyte) files, causing a lot of unnessessary server activity and disk space usage. Anyone have a clue what's going on here? Thanks. ***** Steve Snyder *****
> Using Samba v1.9.18p3 on a Linux system, I find that that any print jobs > sent to a shared printer results in doubled files. It's not that 2 > copies of the print job are actually *printed*, it's just a matter of > dual spool files being created.Samba spools the files and the uses the value of 'lpr command' to print the file. For example, if you are using "/usr/ucb/lpr -P %p %s; rm %s" as the print command, samba effectively does a "cat $FILE | $LPRCOMMAND" The dual spooling is normal. If you wish to send the job directly to the printer, you will have to use some sort of LPR client on the Windows box and bypass samba. PS : Check the man pages on "lpr command" and others (ie. lprm, lpq, etc... ) for more info and use testparm to see what value for the commands is currently set. Hope this helps, j- ________________________________________________________________________ Gerald ( Jerry ) Carter Engineering Network Services Auburn University jerry@eng.auburn.edu http://www.eng.auburn.edu/users/cartegw "...a hundred billion castaways looking for a home." - Sting "Message in a Bottle" ( 1979 )
Gerald W. Carter" <cartegw@Eng.Auburn.EDU> wrote: |> Using Samba v1.9.18p3 on a Linux system, I find that that any print jobs |> sent to a shared printer results in doubled files. It's not that 2 |> copies of the print job are actually *printed*, it's just a matter of |> dual spool files being created. | | Samba spools the files and the uses the value of 'lpr command' to print | the file. For example, if you are using "/usr/ucb/lpr -P %p %s; rm %s" | as the print command, samba effectively does a "cat $FILE | $LPRCOMMAND" | The dual spooling is normal. [snip] Assuming that's correct (and I strongly suspect it is), and assuming you're using the lpr (as opposed to lp) command, try "/usr/ucb/lpr -s -P%p %s; rm %s" This will avoid the spooler making a second copy. You can also try the lp command (System V), as it tries not to take copies unless you say ``-c''. --dave (too many assumptions! take some out!) c-b -- David Collier-Brown, | Always do right. This will gratify some people 185 Ellerslie Ave., | and astonish the rest. -- Mark Twain Willowdale, Ontario | davecb@hobbes.ss.org, canada.sun.com M2N 1Y3. 416-223-8968 | http://java.science.yorku.ca/~davecb
Jonathan Crompton wrote:> My concern was that the rm would execute whilst the lpr'd job was > still in the queue. Isn't this a problem?Indeed it is! Thanks... Test your lpr -r before considering using -s, folks!> > Jonathan.-- David Collier-Brown, | Always do right. This will gratify some people 185 Ellerslie Ave., | and astonish the rest. -- Mark Twain Willowdale, Ontario | davecb@hobbes.ss.org, canada.sun.com M2N 1Y3. 416-223-8968 | http://java.science.yorku.ca/~davecb