Operating System - HP-UX
1837864 Members
3064 Online
110122 Solutions
New Discussion

Re: Dynamic redirection of print jobs

 
Chirag Parekh
Advisor

Dynamic redirection of print jobs

Hi,

Is there an option or some tool for HP-UX 11/11.11 to dynamically redirect a print job generated on a print queue to more than 1 printer?

Thanks,

Chirag.
4 REPLIES 4
Yang Qin_1
Honored Contributor

Re: Dynamic redirection of print jobs

Hi, you can write a script using "lpstat" to collect printing job information then use "lpalt ID -d$dest" to redirect the print job. You can analyze the output from "lpstat" and then assign a printer as $dest in "lpalt ID -d$dest".

You can schedule the script via cron. You can also run it in a loop as a background job.


Yang
Chirag Parekh
Advisor

Re: Dynamic redirection of print jobs

Hi Yang,

Do you have a script to do that as I am a newbie with scripting. Also is there a way to do it other than scripting like some configuration changes, etc.

Thanks.
Yang Qin_1
Honored Contributor

Re: Dynamic redirection of print jobs

Hi, Chirag, I do not have this kind of script, but I think people there will try to write some if you can provide a bit more information like in which condition you want to redirect the print jobs, how many jobs will be redirect to how many printers, how you are going to select the printers as redirect candidates ...

I don't know if there is a configuration option exist for dymanic printing rederict.


Yang
Tor-Arne Nostdal
Trusted Contributor

Re: Dynamic redirection of print jobs

Short answer:
There is "no option" to do this in standard printing.

Long answer:
Corect way - install another spooling software.
But you can do this by scripting or other workarounds.
Printing is handled by "piping" and a piped dataflow can be redirected to multiple destinations.

There is a lot of considerations to make on this issue...

Where to "hook into the dataflow"?

You could either make sure that the program you print from is printing to two printers at the same time... Or change a printer definition so it is sent to two different addresses...

Whatever you do, it is not supported and you might have some problems.

Example on potential problem.
"Job Control"
If you hardcode a printer defintion/queue towards two physical printers... and it always fails on one of the printers...
The job might be automatically restarted endlessly...
If you remove Job Control, it might fail and not get restarted...

Standard HP-UX printing:
printer definitions is stored beneath /etc/lp/interface.

Printername=MYLP01
There should be a file /etc/lp/interface/MYLP01 (and /etc/lp/interface/model.orig/MYLP01)

You can hook into this file and create a split output

/2r
I'm trying to become President of the state I'm in...