[Samba] Print Job Notification

Joel Hammer Joel at HammersHome.com
Sat Jun 22 14:03:32 GMT 2002

I don't do these things but:

Look into preexec and postexec commands in smb.conf.  Look into your
print filter. If it is a simple script, you could just add your smbclient
command there, if the Gods of Permissions are smiling.

Now, how to tell if the job is successfully printed might take some more
effort. You may have to dig into your printing software a bit to find out
how to do that. Maybe you could capture an exit code from the command in
your print filter that actually sends the file to standard out in your
filter. I haven't tried this, but it might work. 
Or capture the results in your status log. This seems much more involved,

On Sat, Jun 22, 2002 at 03:31:28PM -0500, Chad Edwards wrote:
> Can anyone suggest a way to have a notification after a print job has
> completed. I currently have this as my print command:
> lpr -r -P%p %s; csh -c 'echo \"%J has started printing on %S\" |
> /usr/bin/smbclient -U %L -M %m -I %I' &
> It kind of does what I want, but notice that the message says that "Job has
> STARTED printing on Printer". This is because with this command the message
> is sent after the lpr command is executed and not when the job is actually
> done. I would really prefer the message be sent when the job is done, not
> when it is starting.
> I saw an old message in the archives suggesting a wrapper for the print
> command that would keep checking the print queue to see when the job was
> done and then send the message. This sounds like it would work, but I don't
> have a clue how to write the wrapper to check the queue.
> Any help in this matter would be appreciated.
> Chad Edwards
> Samba Newbie
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba

More information about the samba mailing list