Avatar of jalosa
 asked on

Pulling something back from the unix spooler


I'm hoping someone can help. I'm trying to write routine to retrive the text of a print job that has already been submitted to the lp subsystem for printing.

There is a 3rd party software program that we have no control over that sends its output (simple ASCII) to a particular queue, which has no printer physically attached. I'm looking for a way to retrieve that output. The directories and files of the lpd daemon (/var/spool/blah/blah/blah) are all owned by root (and I do not want this script to run as root), so I cannot simply copy the output with cp. I can, however, run it with the same userid as the spooling program.

Is there a way to "redirect" the output from a job awaiting printing? BTW, I'm running a recent version of DEC UNIX on this box.


Unix OS

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

It will be easy to check this 3rd party documens of how to configure it's output.
If no docs, then search for any env setting at it's script.

good Luck

Thanks for the replies, but the 3rd party installation is "hostile". I have no docs (don't even think they exist). Also a wrapper is not feasible for other reasons that I won't go into here (but good idea).

I need a command line or short script solution. I have no control over the job prior to it arriving in the queue. Is there no command to redirect the output for a job you own?

that means you are not the owner of this job. so who support this application if something going bad.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

What exactly do you need to do with the print job? By "redirect", do you mean you are trying to send it to another printer or are you trying to make a copy of the actual file into another directory?  Try to give some more detail.