print command: ? for decent print accounting (Was [Samba] Printing. The REAL jobname. )

Matthew Western mwestern at
Tue Jun 3 02:42:33 GMT 2003

Hi All,
i'm still trying to persue this thing with the real jobname getting logged.
i want to have the following (as per the example in the man page):

print command = echo Printing %J %c %p >> /tmp/job.log; lpr -P %p %s; rm %s

funnily enough the cups manages to get the username that submitted the job,
but i can't see a % thing to pass the username though to a log file.

i might mention i have cups as the backend:

   comment = All Printers
   path = /var/spool/samba
   ; browseable = no
   # Set public = yes to allow user 'guest account' to print
   ; guest ok = yes
   public = yes
   writable = yes
   printable = yes

anybody done this kind of thing before?


-----Original Message-----
From: samba-bounces at
[mailto:samba-bounces at]On Behalf Of mwestern at
Sent: Thursday, May 22, 2003 12:16 PM
To: samba at
Subject: [Samba] Printing. The REAL jobname. :)

Hi All,
I've got a very nicely working samba server with cups as the backend.  i
also have a colour printer on which I must do billing every month.

i've done a test page or two and the username comes though to the colour
printer which is good.  problem i had is the jobname in the logs is
smbprn_xxxxxxxx_xx (numbers) which is the samba job name.  if joe bloggs
complains and says he didn't print that many jobs, we've no way of saying
here's what you printed with samba because it's not recognizable to them.

Does anybody know anything about how the jobname gets crunched etc and can
it be logged to the samba log file somehow in the worst case.  this would
work if there is no way samba/cups can pass though the original name of the

On a side note, i've got a pdf printer setup with samba/cups and have
modified the pdf script that writes the pdf to dig out the %%Title from the
postscript file and make that the ending .pdf file.  but obviously i can't
do that with the lpd because it's not a text script.

Anyone got some brilliant ideas?
To unsubscribe from this list go to the following URL and read the

More information about the samba mailing list